diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java index bb62c8b..51f2386 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DepartController.java @@ -1,5 +1,6 @@ package com.lyms.talkonlineweb.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -192,4 +193,27 @@ public class DepartController { } + /** + * PC-查询同一家医院科室名称是否重复 + * @param hid 所属医院 + * @param dname 科室名称 + * @return true 可以使用,false已经存在 + */ + @GetMapping("getDepartByParam") + public BaseResponse getDepartByParam(Integer hid,String dname){ + BaseResponse baseResponse=new BaseResponse(); + try { + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq("hid", hid); + queryWrapper.eq("dname", dname); + LymsHdepart lymsHdepart=lymsHdepartService.getOne(queryWrapper); + baseResponse.setObject(null==lymsHdepart?true:false); + baseResponse.setErrormsg("成功"); + } catch (Exception e) { + baseResponse.setErrormsg("失败"); + e.printStackTrace(); + } + return baseResponse; + } + } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java index df55a14..af57bc1 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java @@ -1,9 +1,11 @@ package com.lyms.talkonlineweb.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.LymsDict; import com.lyms.talkonlineweb.domain.LymsHdepart; +import com.lyms.talkonlineweb.domain.LymsUser; import com.lyms.talkonlineweb.domain.Regions; import com.lyms.talkonlineweb.result.BaseResponse; import com.lyms.talkonlineweb.service.LymsDictService; @@ -75,6 +77,13 @@ public class RegionsController { return baseResponse; } + /** + * 字典列表展示 + * @param dict + * @param current + * @param size + * @return + */ @GetMapping("sltDict") public BaseResponse sltDepartLst(LymsDict dict, int current, int size){ BaseResponse baseResponse=new BaseResponse(); @@ -85,4 +94,27 @@ public class RegionsController { return baseResponse; } + /** + * PC-查询同vtype类型字code典编码是否重复 + * @param vtype 所属类型 + * @param code 编码 + * @return true 可以使用,false已经存在 + */ + @GetMapping("getDictByParam") + public BaseResponse getDictByParam(Integer vtype,Integer code){ + BaseResponse baseResponse=new BaseResponse(); + try { + QueryWrapper queryWrapper=new QueryWrapper<>(); + queryWrapper.eq("vtype", vtype); + queryWrapper.eq("code", code); + LymsDict dict=lymsDictService.getOne(queryWrapper); + baseResponse.setObject(null==dict?true:false); + baseResponse.setErrormsg("成功"); + } catch (Exception e) { + baseResponse.setErrormsg("失败"); + e.printStackTrace(); + } + return baseResponse; + } + } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/UserContoller.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/UserContoller.java index 8fca22e..8ed1730 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/UserContoller.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/UserContoller.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.annotation.TokenRequired; +import com.lyms.talkonlineweb.domain.LymsAttention; import com.lyms.talkonlineweb.domain.LymsPermission; import com.lyms.talkonlineweb.domain.LymsUser; import com.lyms.talkonlineweb.domain.UserroleInfo; @@ -29,6 +30,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpSession; +import java.sql.Wrapper; import java.util.*; import java.util.concurrent.TimeUnit; @@ -303,6 +305,25 @@ public class UserContoller { return baseResponse; } + /** + * PC-查询登陆账号是否存在 + * @param login 账号 + * @return true 可以使用,false已经存在 + */ + @GetMapping("getLoginUserByLogin") + public BaseResponse getLoginUserByLogin(String login){ + BaseResponse baseResponse=new BaseResponse(); + try { + LymsUser user=lymsUserService.getOne(new QueryWrapper().eq("login", login)); + baseResponse.setObject(null==user?true:false); + baseResponse.setErrormsg("成功"); + } catch (Exception e) { + baseResponse.setErrormsg("失败"); + e.printStackTrace(); + } + return baseResponse; + } + public static void main(String[] args) { System.out.println(DigestUtils.md5DigestAsHex("passwd".getBytes()));; }