lsw hace 9 meses
padre
commit
fd5fcf452d
Se han modificado 26 ficheros con 581 adiciones y 455 borrados
  1. 11 6
      admin-ui/src/components/editor.vue
  2. 0 67
      admin-ui/src/views/work/introduction/edit.vue
  3. 60 97
      admin-ui/src/views/work/introduction/index.vue
  4. 17 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_CommonController.java
  5. 33 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/InterceptorConfig.java
  6. 42 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/TokenInterceptor.java
  7. 158 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/TokenServices.java
  8. 0 66
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/HospitalDeptController.java
  9. 16 71
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/IntroductionController.java
  10. 66 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/UserController.java
  11. 0 27
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/HospitalDept.java
  12. 36 8
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Introduction.java
  13. 47 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/User.java
  14. 0 13
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/HospitalDeptMapper.java
  15. 2 7
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/IntroductionMapper.java
  16. 13 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/UserMapper.java
  17. 0 13
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IHospitalDeptService.java
  18. 2 6
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IIntroductionService.java
  19. 13 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IUserService.java
  20. 0 24
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/HospitalDeptServiceImpl.java
  21. 3 17
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/IntroductionServiceImpl.java
  22. 24 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/UserServiceImpl.java
  23. 0 16
      ruoyi-admin/src/main/resources/mapper/work/HospitalDeptMapper.xml
  24. 0 17
      ruoyi-admin/src/main/resources/mapper/work/IntroductionMapper.xml
  25. 36 0
      ruoyi-admin/src/main/resources/mapper/work/UserMapper.xml
  26. 2 0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java

+ 11 - 6
admin-ui/src/components/editor.vue

@@ -6,6 +6,10 @@
 import { uploadFile } from '@/api/common';
 import { uploadFile } from '@/api/common';
 export default {
 export default {
   props: {
   props: {
+    readonly: {
+      type: Boolean,
+      default: false
+    },
     height: {
     height: {
       type: Number,
       type: Number,
       default: 450
       default: 450
@@ -22,22 +26,23 @@ export default {
       setting: {
       setting: {
         menubar: false,
         menubar: false,
         ProgressState: true,
         ProgressState: true,
+        readonly: this.readonly,
         toolbar:
         toolbar:
           'fullscreen preview code | undo redo | lineheight bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | numlist bullist | upfile image axupimgs media importword table | formatselect fontselect fontsizeselect forecolor backcolor | indent outdent | superscript subscript | removeformat | wordcount | help',
           'fullscreen preview code | undo redo | lineheight bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | numlist bullist | upfile image axupimgs media importword table | formatselect fontselect fontsizeselect forecolor backcolor | indent outdent | superscript subscript | removeformat | wordcount | help',
         toolbar_drawer: 'sliding',
         toolbar_drawer: 'sliding',
         quickbars_selection_toolbar: 'removeformat | bold italic underline strikethrough | fontsizeselect forecolor backcolor',
         quickbars_selection_toolbar: 'removeformat | bold italic underline strikethrough | fontsizeselect forecolor backcolor',
-        plugins: 'paste preview code lineheight wordcount upfile image axupimgs imagetools media table lists fullscreen quickbars help',
+        plugins: 'preview code lineheight wordcount upfile image axupimgs imagetools media table lists fullscreen quickbars help',
         language: 'zh_CN',
         language: 'zh_CN',
         content_style: 'img {max-width:100%;}', //编辑器内限制图片大小
         content_style: 'img {max-width:100%;}', //编辑器内限制图片大小
         convert_urls: false,
         convert_urls: false,
         height: this.height,
         height: this.height,
-        paste_data_images: true, // 默认是false的,true才能粘贴
+        paste_data_images: true,
         //图片上传
         //图片上传
         images_upload_handler: (blobInfo, succFun, failFun) => {
         images_upload_handler: (blobInfo, succFun, failFun) => {
           let formData = new FormData();
           let formData = new FormData();
           formData.append('file', blobInfo.blob());
           formData.append('file', blobInfo.blob());
           uploadFile(formData)
           uploadFile(formData)
-            .then(response => {
+            .then((response) => {
               this.$modal.msgSuccess('上传成功');
               this.$modal.msgSuccess('上传成功');
               succFun(this.baseUrl + response.fileName);
               succFun(this.baseUrl + response.fileName);
             })
             })
@@ -47,7 +52,7 @@ export default {
           let formData = new FormData();
           let formData = new FormData();
           formData.append('file', file);
           formData.append('file', file);
           uploadFile(formData)
           uploadFile(formData)
-            .then(response => {
+            .then((response) => {
               this.$modal.msgSuccess('上传成功');
               this.$modal.msgSuccess('上传成功');
               succFun(this.baseUrl + response.fileName);
               succFun(this.baseUrl + response.fileName);
             })
             })
@@ -78,7 +83,7 @@ export default {
             let formData = new FormData();
             let formData = new FormData();
             formData.append('file', file, file.name);
             formData.append('file', file, file.name);
             uploadFile(formData)
             uploadFile(formData)
-              .then(response => {
+              .then((response) => {
                 this.$modal.msgSuccess('上传成功');
                 this.$modal.msgSuccess('上传成功');
                 callback(this.baseUrl + response.fileName);
                 callback(this.baseUrl + response.fileName);
               })
               })
@@ -116,6 +121,6 @@ export default {
 }
 }
 .tox-shadowhost.tox-fullscreen,
 .tox-shadowhost.tox-fullscreen,
 .tox.tox-tinymce.tox-fullscreen {
 .tox.tox-tinymce.tox-fullscreen {
-  z-index: 1200000!important;
+  z-index: 1200000 !important;
 }
 }
 </style>
 </style>

+ 0 - 67
admin-ui/src/views/work/introduction/edit.vue

@@ -1,67 +0,0 @@
-<template>
-  <div class="cmain">
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="标题" prop="title">
-          <el-input v-model="form.title" placeholder="请输入标题" clearable/>
-        </el-form-item>
-        <el-form-item label="介绍" prop="context">
-          <editor v-model="form.context" :min-height="192"/>
-        </el-form-item>
-      </el-form>
-    <div class="mfooter">
-      <el-button type="primary" @click="submitForm">确 定</el-button>
-      <el-button @click="$layer.close(layerid)">取 消</el-button>
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      form: {},
-      rules: {
-      }
-    };
-  },
-  props: {
-    param: {
-      type: Object,
-      default: () => {
-        return {};
-      }
-    },
-    layerid: {
-      type: String
-    }
-  },
-  mounted() {
-    if (this.param.id) {
-      this.ajax({ url: '/work/introduction/detail/' + this.param.id }).then(response => {
-        this.form = response.data;
-      });
-    }
-  },
-  methods: {
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id) {
-              this.ajax({method: 'post',url: '/work/introduction/edit', data: this.form }).then(response => {
-                  this.$modal.msgSuccess("修改成功");
-                  this.$layer.close(this.layerid);
-                  this.$parent.getList();
-              });
-          } else {
-              this.ajax({method: 'post',url: '/work/introduction/add', data: this.form }).then(response => {
-                  this.$modal.msgSuccess("新增成功");
-                  this.$layer.close(this.layerid);
-                  this.$parent.getList();
-               });
-          }
-        }
-      });
-    }
-  }
-};
-</script>

+ 60 - 97
admin-ui/src/views/work/introduction/index.vue

@@ -1,114 +1,77 @@
 <template>
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
-      <el-form-item label="标题" prop="title">
-        <el-input v-model="queryParams.title" placeholder="请输入标题"  @keyup.enter.native="handleQuery" clearable class="inp"/>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-    <el-row :gutter="10" class="mb8">
-        <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:introduction:add']">新增</el-button>
-        <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit',ids)" v-hasPermi="['work:introduction:edit']">修改</el-button>
-        <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:introduction:remove']">删除{{ids.length>0?'('+ids.length+')':''}}</el-button>
-        
-    </el-row>
-
-    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="标题" align="center" prop="title" />
-<!--      <el-table-column label="介绍" align="center" prop="context" />-->
-      <el-table-column label="状态" align="center" prop="status" >
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.work_status" :value="scope.row.status"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-refresh-left"
-            @click="updateStatus(scope.row)"
-            v-hasPermi="['work:introduction:updateStatus']"
-          >更改状态</el-button>
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit',scope.row)" v-hasPermi="['work:introduction:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:introduction:remove']">删除</el-button>
-        </template>
-      </el-table-column>
-      <template slot="empty">
-          <el-empty></el-empty>
-      </template>
-    </el-table>
-    <pagination v-if="response.total>0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
+  <div class="app-container" style="overflow-y: auto">
+    <div class="cmain">
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <div class="bos">
+          <div class="lab">
+            <div class="bsg"></div>
+            <div class="tit">医院基本信息</div>
+          </div>
+          <el-form-item label="医院电话" prop="phone">
+            <el-input v-model="form.phone" placeholder="请输入" clearable />
+          </el-form-item>
+          <el-form-item label="医院地址" prop="address">
+            <el-input v-model="form.address" placeholder="请输入" clearable />
+          </el-form-item>
+          <el-form-item label="医院邮箱" prop="email">
+            <el-input v-model="form.email" placeholder="请输入" clearable />
+          </el-form-item>
+          <el-form-item label="医院介绍" prop="brief">
+            <editor v-model="form.brief" placeholder="请输入"></editor>
+          </el-form-item>
+        </div>
+        <div class="bos">
+          <div class="lab">
+            <div class="bsg"></div>
+            <div class="tit">协议(小程序上架需要)</div>
+          </div>
+          <el-form-item label="用户协议" prop="privacy">
+            <editor v-model="form.agreement" placeholder="请输入"></editor>
+          </el-form-item>
+          <el-form-item label="隐私政策" prop="privacy">
+            <editor v-model="form.privacy" placeholder="请输入"></editor>
+          </el-form-item>
+        </div>
+      </el-form>
+      <div>
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="$layer.close(layerid)">取 消</el-button>
+      </div>
+    </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import edit from './edit'
 export default {
 export default {
-  dicts: ['work_status'],
-  name: "Introduction",
   data() {
   data() {
     return {
     return {
-      ids: [],
-      showSearch:true,
-      response: {},
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-                      title: null,
-                      context: null,
-                      status: null,
-                orderByColumn:'id', //排序字段
-                isAsc: 'desc' //排序方式
+      form: {},
+      rules: {
+        address: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        phone: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        email: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        brief: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        privacy: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        agreement: [{ required: true, message: '不能为空', trigger: 'blur' }]
       }
       }
     };
     };
   },
   },
-  created() {
-    this.getList();
+  mounted() {
+    this.ajax({ url: '/work/introduction/detail' }).then((response) => {
+      this.form = response.data;
+    });
   },
   },
   methods: {
   methods: {
-    updateStatus(row){
-      this.ajax({method: 'post',url: '/work/introduction/updateStatus', data: row }).then(response => {
-        this.$modal.msgSuccess(response.msg);
-        this.getList()
-      });
-    },
-    getList() {
-      this.ajax({ url: '/work/introduction/list', data: this.queryParams }).then(response => {
-            this.response = response;
-      });
-    },
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    selects(rows) {
-      this.ids = rows.map(item => item.id)
-    },
-    op(tag, row) {
-          if (tag == 'add') {
-            this.iframe({ obj: edit, param: {}, title:'新增',width: '1000px', height: '700px'});
-          }
-          if (tag == 'edit') {
-              const id = row.id || this.ids[0];
-              this.iframe({ obj: edit, param: {id: id}, title:'编辑',width: '1000px', height: '700px'});
-          }
-    },
-    del(row) {
-        this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
-        this.get({ url: '/work/introduction/remove/' + (row.id || this.ids) }).then(response => {
-                this.$modal.msgSuccess('删除成功');
-                this.getList();
+    submitForm() {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.id) {
+            this.ajax({ method: 'post', url: '/work/introduction/edit', data: this.form }).then((response) => {
+              this.$modal.msgSuccess('修改成功');
             });
             });
-        });
+          }
+        }
+      });
     }
     }
   }
   }
 };
 };

+ 17 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_CommonController.java

@@ -1,12 +1,14 @@
 package com.ruoyi.web.work.api;
 package com.ruoyi.web.work.api;
 
 
 import com.google.code.kaptcha.Producer;
 import com.google.code.kaptcha.Producer;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.service.ISysDictTypeService;
 import com.ruoyi.system.service.ISysDictTypeService;
 import com.ruoyi.web.work.api.config.BaseController;
 import com.ruoyi.web.work.api.config.BaseController;
+import com.ruoyi.web.work.domain.Introduction;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -41,5 +43,20 @@ public class Api_CommonController extends BaseController {
         }
         }
         return AjaxResult.success(data);
         return AjaxResult.success(data);
     }
     }
+
+    @GetMapping(value = "/introduction/{title}")
+    public AjaxResult introduction(@PathVariable String title) {
+        Introduction introduction = redisCache.getCacheObject(CacheConstants.APP_INFO);
+        if (title.equals("用户协议")) {
+            return AjaxResult.success(introduction.getAgreement());
+        }
+        if (title.equals("隐私政策")) {
+            return AjaxResult.success(introduction.getPrivacy());
+        }
+        if (title.equals("医院介绍")) {
+            return AjaxResult.success(introduction);
+        }
+        return AjaxResult.error();
+    }
 }
 }
 
 

+ 33 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/InterceptorConfig.java

@@ -0,0 +1,33 @@
+package com.ruoyi.web.work.api.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class InterceptorConfig implements WebMvcConfigurer {
+
+    //在此处,将拦截器注册为一个 Bean
+    @Bean
+    public TokenInterceptor tokenInterceptor() {
+        return new TokenInterceptor();
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        InterceptorRegistration registration = registry.addInterceptor(tokenInterceptor());
+        registration.addPathPatterns("/app/**");
+        registration.excludePathPatterns("/app/user/login"); //排除
+        registration.excludePathPatterns("/app/home/**"); //排除
+        registration.excludePathPatterns("/app/common/type/*"); //排除
+        registration.excludePathPatterns("/app/common/agreement/*"); //排除
+    }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+    }
+}
+

+ 42 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/TokenInterceptor.java

@@ -0,0 +1,42 @@
+package com.ruoyi.web.work.api.config;
+
+import com.alibaba.druid.support.json.JSONUtils;
+import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.web.work.domain.User;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+public class TokenInterceptor implements HandlerInterceptor {
+
+    @Autowired
+    private TokenServices tokenService;
+
+    @Override
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) {
+        String token = request.getHeader("Authorization");
+        if (StringUtils.isEmpty(token)) {
+            ServletUtils.renderString(response, JSONUtils.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "请先登陆")));
+            return false;
+        }
+        User user = tokenService.getLoginUser(token);
+        if (user == null) {
+            ServletUtils.renderString(response, JSONUtils.toJSONString(AjaxResult.error(HttpStatus.UNAUTHORIZED, "登录已过期,请重新登陆")));
+            return false;
+        }
+        if (user.getState() == 1) {
+            ServletUtils.renderString(response, JSONUtils.toJSONString(AjaxResult.error(HttpStatus.FORBIDDEN, "你的账号被锁定,无法操作")));
+            tokenService.delLoginUser(user.getToken());
+            return false;
+        }
+        request.setAttribute("user", user);
+        return true;
+    }
+
+}

+ 158 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/config/TokenServices.java

@@ -0,0 +1,158 @@
+package com.ruoyi.web.work.api.config;
+
+import com.ruoyi.common.constant.CacheConstants;
+import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.web.work.domain.User;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * token验证处理
+ */
+@Component
+public class TokenServices {
+    // 令牌自定义标识
+    @Value("${token.header}")
+    private String header;
+
+    // 令牌秘钥
+    @Value("${token.secret}")
+    private String secret;
+
+    // 令牌有效期(默认30分钟)
+    @Value("${token.expireTime}")
+    private int expireTime;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    /**
+     * 获取用户身份信息
+     *
+     * @return 用户信息
+     */
+    public User getLoginUser(String token) {
+        Claims claims = null;
+        try {
+            claims = parseToken(token);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+        // 解析对应的权限以及用户信息
+        String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
+        String userKey = getTokenKey(uuid);
+        User user = redisCache.getCacheObject(userKey);
+        if (user != null) {
+            return user;
+        }
+        return null;
+    }
+
+    /**
+     * 删除用户身份信息
+     */
+    public void delLoginUser(String token) {
+        if (StringUtils.isNotEmpty(token)) {
+            String userKey = getTokenKey(token);
+            redisCache.deleteObject(userKey);
+        }
+    }
+
+    /**
+     * 创建令牌
+     *
+     * @param user 用户信息
+     * @return 令牌
+     */
+    public String createToken(User user) {
+        String token = IdUtils.fastUUID();
+        user.setToken(token);
+        refreshToken(user);
+        Map<String, Object> claims = new HashMap<>();
+        claims.put(Constants.LOGIN_USER_KEY, token);
+        return createToken(claims);
+    }
+
+    /**
+     * 刷新令牌有效期
+     *
+     * @param user 登录信息
+     */
+    public void refreshToken(User user) {
+        // 根据uuid将loginUser缓存
+        String userKey = getTokenKey(user.getToken());
+        redisCache.setCacheObject(userKey, user, expireTime,TimeUnit.MINUTES);
+    }
+
+    /**
+     * 设置用户身份信息
+     */
+    public void setLoginUser(User user) {
+        if (StringUtils.isNotNull(user) && StringUtils.isNotEmpty(user.getToken())) {
+            refreshToken(user);
+        }
+    }
+
+    /**
+     * 从数据声明生成令牌
+     *
+     * @param claims 数据声明
+     * @return 令牌
+     */
+    private String createToken(Map<String, Object> claims) {
+        String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact();
+        return token;
+    }
+
+    /**
+     * 从令牌中获取数据声明
+     *
+     * @param token 令牌
+     * @return 数据声明
+     */
+    private Claims parseToken(String token) {
+        return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
+    }
+
+    /**
+     * 从令牌中获取用户名
+     *
+     * @param token 令牌
+     * @return 用户名
+     */
+    public String getUsernameFromToken(String token) {
+        Claims claims = parseToken(token);
+        return claims.getSubject();
+    }
+
+    /**
+     * 获取请求token
+     *
+     * @param request
+     * @return token
+     */
+    private String getToken(HttpServletRequest request) {
+        String token = request.getHeader(header);
+        if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) {
+            token = token.replace(Constants.TOKEN_PREFIX, "");
+        }
+        return token;
+    }
+
+    private String getTokenKey(String uuid) {
+        return CacheConstants.APP_LOGIN_TOKEN_KEY + uuid;
+    }
+}

+ 0 - 66
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/HospitalDeptController.java

@@ -1,66 +0,0 @@
-package com.ruoyi.web.work.controller;
-
-import java.util.Arrays;
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.web.work.domain.HospitalDept;
-import com.ruoyi.web.work.service.IHospitalDeptService;
-import com.ruoyi.common.core.page.TableDataInfo;
-
-/**
- * 医院科室
- * @author lsw
- * @date 2024-07-09
- */
-@RestController
-@RequestMapping("/work/dept")
-public class HospitalDeptController extends BaseController {
-    @Autowired
-    private IHospitalDeptService hospitalDeptService;
-
-    @PreAuthorize("@ss.hasPermi('work:dept:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(HospitalDept hospitalDept){
-        startPage();
-        List<HospitalDept> list = hospitalDeptService.selectList(hospitalDept);
-        return getDataTable(list);
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:dept:query')")
-    @GetMapping(value = "/detail/{id}")
-    public AjaxResult detail(@PathVariable("id") Long id){
-        return AjaxResult.success(hospitalDeptService.getById(id));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:dept:add')")
-    @Log(title = "医院科室", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    public AjaxResult add(@RequestBody HospitalDept hospitalDept){
-        return toAjax(hospitalDeptService.save(hospitalDept));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:dept:edit')")
-    @Log(title = "医院科室", businessType = BusinessType.UPDATE)
-    @PostMapping("/edit")
-    public AjaxResult edit(@RequestBody HospitalDept hospitalDept){
-        return toAjax(hospitalDeptService.updateById(hospitalDept));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:dept:remove')")
-    @Log(title = "医院科室", businessType = BusinessType.DELETE)
-    @GetMapping("/remove/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids){
-        return toAjax(hospitalDeptService.removeByIds(Arrays.asList(ids)));
-    }
-}

+ 16 - 71
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/IntroductionController.java

@@ -1,23 +1,16 @@
 package com.ruoyi.web.work.controller;
 package com.ruoyi.web.work.controller;
 
 
-import java.util.Arrays;
-import java.util.List;
-
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.web.work.domain.Introduction;
 import com.ruoyi.web.work.domain.Introduction;
 import com.ruoyi.web.work.service.IIntroductionService;
 import com.ruoyi.web.work.service.IIntroductionService;
-import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
 
 
 /**
 /**
  * 医院介绍
  * 医院介绍
@@ -31,72 +24,24 @@ public class IntroductionController extends BaseController {
     @Autowired
     @Autowired
     private IIntroductionService introductionService;
     private IIntroductionService introductionService;
 
 
-    @PreAuthorize("@ss.hasPermi('work:introduction:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(Introduction introduction) {
-        startPage();
-        List<Introduction> list = introductionService.selectList(introduction);
-        return getDataTable(list);
-    }
+    @Autowired
+    private RedisCache redisCache;
 
 
-    @PreAuthorize("@ss.hasPermi('work:introduction:query')")
-    @GetMapping(value = "/detail/{id}")
-    public AjaxResult detail(@PathVariable("id") Long id) {
-        return AjaxResult.success(introductionService.getById(id));
+    @GetMapping(value = "/detail")
+    public AjaxResult detail() {
+        return AjaxResult.success(introductionService.getById(1));
     }
     }
 
 
-    @PreAuthorize("@ss.hasPermi('work:introduction:add')")
-    @Log(title = "医院介绍", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    public AjaxResult add(@RequestBody Introduction introduction) {
-        return toAjax(introductionService.save(introduction));
-    }
 
 
     @PreAuthorize("@ss.hasPermi('work:introduction:edit')")
     @PreAuthorize("@ss.hasPermi('work:introduction:edit')")
-    @Log(title = "医院介绍", businessType = BusinessType.UPDATE)
+    @Log(title = "编辑医院介绍", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     @PostMapping("/edit")
     public AjaxResult edit(@RequestBody Introduction introduction) {
     public AjaxResult edit(@RequestBody Introduction introduction) {
-        return toAjax(introductionService.updateById(introduction));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:introduction:remove')")
-    @Log(title = "医院介绍", businessType = BusinessType.DELETE)
-    @GetMapping("/remove/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(introductionService.removeByIds(Arrays.asList(ids)));
-    }
-
-    @PreAuthorize("@ss.hasPermi('work:introduction:updateStatus')")
-    @Log(title = "医院介绍更新状态", businessType = BusinessType.UPDATE)
-    @PostMapping("/updateStatus")
-    public AjaxResult updateStatusedit(@RequestBody Introduction introduction) {
-
-
-        //记录id
-        String titles = "";
-        if (introduction.getStatus() == 0) {
-            //查出所有的状态为启用然后设为停用
-            for (Introduction introduct : introductionService.selectList(new Introduction())) {
-                if (introduct.getStatus() == 1) {
-                    titles = titles.concat(introduct.getTitle());
-                    introduct.setStatus(0);
-                    introductionService.updateStatus(introduct);
-                }
-            }
-        }
-
-
-        Introduction intro = new Introduction();
-        intro.setId(introduction.getId());
-        intro.setStatus(introduction.getStatus() == 1 ? 0 : 1);
-        introductionService.updateById(intro);
-
-
-        if (!titles.isEmpty()) {
-            return AjaxResult.success("已将" + titles + "设置为停用," + introduction.getTitle() + "已设置为启用!");
-        } else {
-            return AjaxResult.success(introduction.getTitle() + "已" + (introduction.getStatus().equals(1) ? "停用" : "启用"));
+        boolean row = introductionService.updateById(introduction);
+        if (row) {
+            redisCache.setCacheObject(CacheConstants.APP_INFO, introduction);
         }
         }
-
+        return toAjax(row);
     }
     }
+
 }
 }

+ 66 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/UserController.java

@@ -0,0 +1,66 @@
+package com.ruoyi.web.work.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.web.work.domain.User;
+import com.ruoyi.web.work.service.IUserService;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 小程序用户
+ * @author lsw
+ * @date 2024-07-16
+ */
+@RestController
+@RequestMapping("/work/user")
+public class UserController extends BaseController {
+    @Autowired
+    private IUserService userService;
+
+    @PreAuthorize("@ss.hasPermi('work:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(User user){
+        startPage();
+        List<User> list = userService.selectList(user);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:user:query')")
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id){
+        return AjaxResult.success(userService.getById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:user:add')")
+    @Log(title = "小程序用户", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody User user){
+        return toAjax(userService.save(user));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:user:edit')")
+    @Log(title = "小程序用户", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody User user){
+        return toAjax(userService.updateById(user));
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:user:remove')")
+    @Log(title = "小程序用户", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids){
+        return toAjax(userService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 0 - 27
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/HospitalDept.java

@@ -1,27 +0,0 @@
-package com.ruoyi.web.work.domain;
-
-import lombok.Data;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.experimental.Accessors;
-/**
- * @author lsw
- * @date 2024-07-09
- */
-@Data
-@TableName(value = "tb_hospital_dept")
-@Accessors(chain = true)
-public class HospitalDept{
-    private static final long serialVersionUID = 1L;
-
-    private Long id;
-
-    private Long parentId;
-
-    @ApiModelProperty(value = "科室名称")
-    private String deptname;
-
-    @ApiModelProperty(value = "科室描述")
-    private String deptdesc;
-
-}

+ 36 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Introduction.java

@@ -1,9 +1,15 @@
 package com.ruoyi.web.work.domain;
 package com.ruoyi.web.work.domain;
 
 
-import lombok.Data;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import lombok.experimental.Accessors;
 import lombok.experimental.Accessors;
+
+import java.util.Date;
+
 /**
 /**
  * @author lsw
  * @author lsw
  * @date 2024-07-10
  * @date 2024-07-10
@@ -11,19 +17,41 @@ import lombok.experimental.Accessors;
 @Data
 @Data
 @TableName(value = "tb_introduction")
 @TableName(value = "tb_introduction")
 @Accessors(chain = true)
 @Accessors(chain = true)
-public class Introduction{
+public class Introduction {
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     private Long id;
     private Long id;
 
 
-    @ApiModelProperty(value = "标题")
-    private String title;
+    @ApiModelProperty(value = "用户协议")
+    private String agreement;
+
+    @ApiModelProperty(value = "隐私政策")
+    private String privacy;
+
+    @ApiModelProperty(value = "医院介绍")
+    private String brief;
+
+    @ApiModelProperty(value = "联系电话")
+    private String phone;
+
+    @ApiModelProperty(value = "医院地址")
+    private String address;
+
+    @ApiModelProperty(value = "医院邮箱")
+    private String email;
+
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
 
 
-    @ApiModelProperty(value = "介绍")
-    private String context;
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
 
 
-    @ApiModelProperty(value = "状态 ( 1:是 ,0:否 )")
-    private Integer status;
+    @TableField(fill = FieldFill.UPDATE)
+    private String updateBy;
 
 
+    @TableField(fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
 
 
 }
 }

+ 47 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/User.java

@@ -0,0 +1,47 @@
+package com.ruoyi.web.work.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+/**
+ * @author lsw
+ * @date 2024-07-16
+ */
+@Data
+@TableName(value = "tb_user")
+@Accessors(chain = true)
+public class User{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "微信id")
+    private String openId;
+
+    @ApiModelProperty(value = "状态:0=正常,1=停用")
+    private Integer state;
+
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @TableField(fill = FieldFill.UPDATE)
+    private String updateBy;
+
+    @TableField(fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @TableField(exist = false)
+    private String token;
+
+}

+ 0 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/HospitalDeptMapper.java

@@ -1,13 +0,0 @@
-package com.ruoyi.web.work.mapper;
-
-import java.util.List;
-import com.ruoyi.web.work.domain.HospitalDept;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * @author lsw
- * @date 2024-07-09
- */
-public interface HospitalDeptMapper extends BaseMapper<HospitalDept> {
-    List<HospitalDept> selectList(HospitalDept hospitalDept);
-}

+ 2 - 7
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/IntroductionMapper.java

@@ -1,15 +1,10 @@
 package com.ruoyi.web.work.mapper;
 package com.ruoyi.web.work.mapper;
 
 
-import java.util.List;
-import com.ruoyi.web.work.domain.Introduction;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.web.work.domain.Introduction;
 
 
 /**
 /**
  * @author lsw
  * @author lsw
  * @date 2024-07-10
  * @date 2024-07-10
  */
  */
-public interface IntroductionMapper extends BaseMapper<Introduction> {
-    List<Introduction> selectList(Introduction introduction);
-
-    int updateStatus(Introduction introduction);
-}
+public interface IntroductionMapper extends BaseMapper<Introduction> {}

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/UserMapper.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.work.mapper;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.User;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author lsw
+ * @date 2024-07-16
+ */
+public interface UserMapper extends BaseMapper<User> {
+    List<User> selectList(User user);
+}

+ 0 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IHospitalDeptService.java

@@ -1,13 +0,0 @@
-package com.ruoyi.web.work.service;
-
-import java.util.List;
-import com.ruoyi.web.work.domain.HospitalDept;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * @author lsw
- * @date 2024-07-09
- */
-public interface IHospitalDeptService extends IService<HospitalDept>{
-    List<HospitalDept> selectList(HospitalDept hospitalDept);
-}

+ 2 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IIntroductionService.java

@@ -1,15 +1,11 @@
 package com.ruoyi.web.work.service;
 package com.ruoyi.web.work.service;
 
 
-import java.util.List;
-import com.ruoyi.web.work.domain.Introduction;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.web.work.domain.Introduction;
 
 
 /**
 /**
  * @author lsw
  * @author lsw
  * @date 2024-07-10
  * @date 2024-07-10
  */
  */
-public interface IIntroductionService extends IService<Introduction>{
-    List<Introduction> selectList(Introduction introduction);
-
-    int updateStatus(Introduction introduction);
+public interface IIntroductionService extends IService<Introduction> {
 }
 }

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IUserService.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.work.service;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.User;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author lsw
+ * @date 2024-07-16
+ */
+public interface IUserService extends IService<User>{
+    List<User> selectList(User user);
+}

+ 0 - 24
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/HospitalDeptServiceImpl.java

@@ -1,24 +0,0 @@
-package com.ruoyi.web.work.service.impl;
-
-import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ruoyi.web.work.mapper.HospitalDeptMapper;
-import com.ruoyi.web.work.domain.HospitalDept;
-import com.ruoyi.web.work.service.IHospitalDeptService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-
-/**
- * @author lsw
- * @date 2024-07-09
- */
-@Service
-public class HospitalDeptServiceImpl extends ServiceImpl<HospitalDeptMapper, HospitalDept> implements IHospitalDeptService {
-    @Autowired
-    private HospitalDeptMapper hospitalDeptMapper;
-
-    @Override
-    public List<HospitalDept> selectList(HospitalDept hospitalDept) {
-        return hospitalDeptMapper.selectList(hospitalDept);
-    }
-}

+ 3 - 17
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/IntroductionServiceImpl.java

@@ -1,12 +1,10 @@
 package com.ruoyi.web.work.service.impl;
 package com.ruoyi.web.work.service.impl;
 
 
-import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ruoyi.web.work.mapper.IntroductionMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.web.work.domain.Introduction;
 import com.ruoyi.web.work.domain.Introduction;
+import com.ruoyi.web.work.mapper.IntroductionMapper;
 import com.ruoyi.web.work.service.IIntroductionService;
 import com.ruoyi.web.work.service.IIntroductionService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
 
 
 /**
 /**
  * @author lsw
  * @author lsw
@@ -14,16 +12,4 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  */
  */
 @Service
 @Service
 public class IntroductionServiceImpl extends ServiceImpl<IntroductionMapper, Introduction> implements IIntroductionService {
 public class IntroductionServiceImpl extends ServiceImpl<IntroductionMapper, Introduction> implements IIntroductionService {
-    @Autowired
-    private IntroductionMapper introductionMapper;
-
-    @Override
-    public List<Introduction> selectList(Introduction introduction) {
-        return introductionMapper.selectList(introduction);
-    }
-
-    @Override
-    public int updateStatus(Introduction introduction) {
-        return introductionMapper.updateStatus(introduction);
-    }
 }
 }

+ 24 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/UserServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ruoyi.web.work.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.web.work.mapper.UserMapper;
+import com.ruoyi.web.work.domain.User;
+import com.ruoyi.web.work.service.IUserService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @author lsw
+ * @date 2024-07-16
+ */
+@Service
+public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
+    @Autowired
+    private UserMapper userMapper;
+
+    @Override
+    public List<User> selectList(User user) {
+        return userMapper.selectList(user);
+    }
+}

+ 0 - 16
ruoyi-admin/src/main/resources/mapper/work/HospitalDeptMapper.xml

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.web.work.mapper.HospitalDeptMapper">
-    
-    <select id="selectList" resultType="com.ruoyi.web.work.domain.HospitalDept">
-        select * from tb_hospital_dept
-        <where>  
-            <if test="deptname != null  and deptname != ''"> and deptName like concat('%', #{deptname}, '%')</if>
-            <if test="deptdesc != null  and deptdesc != ''"> and deptDesc like concat('%', #{deptdesc}, '%')</if>
-            <if test="parentId != null  and parentId != ''"> and parent_id = #{parentId}</if>
-        </where>
-    </select>
-
-</mapper>

+ 0 - 17
ruoyi-admin/src/main/resources/mapper/work/IntroductionMapper.xml

@@ -4,21 +4,4 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.web.work.mapper.IntroductionMapper">
 <mapper namespace="com.ruoyi.web.work.mapper.IntroductionMapper">
 
 
-    <select id="selectList" resultType="com.ruoyi.web.work.domain.Introduction">
-        select * from tb_introduction
-        <where>
-            <if test="title != null  and title != ''">and title like concat('%', #{title}, '%')</if>
-            <if test="context != null  and context != ''">and context like concat('%', #{context}, '%')</if>
-            <if test="status != null  and status != ''">and status = #{status}</if>
-        </where>
-    </select>
-
-    <update id="updateStatus" parameterType="com.ruoyi.web.work.domain.Introduction">
-        update tb_introduction
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="status != null">status = #{status},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
 </mapper>
 </mapper>

+ 36 - 0
ruoyi-admin/src/main/resources/mapper/work/UserMapper.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.web.work.mapper.UserMapper">
+    
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.User">
+        select * from tb_user
+        <where>  
+            <if test="openId != null  and openId != ''"> and open_id = #{openId}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
+            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="nationality != null  and nationality != ''"> and nationality = #{nationality}</if>
+            <if test="birth != null  and birth != ''"> and birth = #{birth}</if>
+            <if test="endDate != null  and endDate != ''"> and end_date = #{endDate}</if>
+            <if test="bankName != null  and bankName != ''"> and bank_name like concat('%', #{bankName}, '%')</if>
+            <if test="bankAccount != null  and bankAccount != ''"> and bank_account = #{bankAccount}</if>
+            <if test="alipay != null  and alipay != ''"> and alipay = #{alipay}</if>
+            <if test="p1 != null  and p1 != ''"> and p1 = #{p1}</if>
+            <if test="p2 != null  and p2 != ''"> and p2 = #{p2}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="isEnterprise != null "> and is_enterprise = #{isEnterprise}</if>
+            <if test="isContract != null "> and is_contract = #{isContract}</if>
+            <if test="isAuthentication != null "> and is_authentication = #{isAuthentication}</if>
+            <if test="isCompany != null "> and is_company = #{isCompany}</if>
+            <if test="contractDate != null "> and contract_date = #{contractDate}</if>
+            <if test="state != null "> and state = #{state}</if>
+            <if test="money != null "> and money = #{money}</if>
+        </where>
+    </select>
+
+</mapper>

+ 2 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java

@@ -107,4 +107,6 @@ public class CacheConstants {
     public static final String APP_PROJECT = "app_project:";
     public static final String APP_PROJECT = "app_project:";
 
 
     public static final String APP_DONATE = "app_donate:";
     public static final String APP_DONATE = "app_donate:";
+
+    public static final String APP_INFO = "app_info:";
 }
 }