|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.manage.controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
import com.manage.dao.Power_DeptMapper;
|
|
|
|
|
import com.manage.dao.Power_NoticeMapper;
|
|
|
|
|
import com.manage.dao.Power_UserMapper;
|
|
|
|
|
import com.manage.entity.Power_Dept;
|
|
|
|
@ -64,39 +66,43 @@ public class FontController {
|
|
|
|
|
private Power_DeptService power_deptService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private Power_UserMapper power_userMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private Power_DeptMapper powerDeptMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.1
|
|
|
|
|
* @ProjectName: getUserPowerTreeBySysFlag
|
|
|
|
|
* @Description: 获取菜单通过系统标识
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return getMenusByUserIdAndSysFlag
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getUserPowerTreeBySysFlag
|
|
|
|
|
* @Description: 获取菜单通过系统标识
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return getMenusByUserIdAndSysFlag
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getMenusByUserIdAndSysFlag",method = RequestMethod.GET)
|
|
|
|
|
@RequestMapping(value = "getMenusByUserIdAndSysFlag", method = RequestMethod.GET)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg getMenusByUserIdAndSysFlag(String userName,String sysFlag,Integer userId,Integer roleId,
|
|
|
|
|
Integer sysId,Integer hospitalId) throws Exception{
|
|
|
|
|
if(StringUtils.isNotBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
|
|
|
|
&& sysId == null && hospitalId == null){
|
|
|
|
|
public Msg getMenusByUserIdAndSysFlag(String userName, String sysFlag, Integer userId, Integer roleId,
|
|
|
|
|
Integer sysId, Integer hospitalId) throws Exception {
|
|
|
|
|
if (StringUtils.isNotBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
|
|
|
|
&& sysId == null && hospitalId == null) {
|
|
|
|
|
return Msg.fail("查询复杂,数据大,暂不支持只带sysFlag参数查询");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
|
|
|
|
&& sysId != null && hospitalId == null){
|
|
|
|
|
if (StringUtils.isBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
|
|
|
|
&& sysId != null && hospitalId == null) {
|
|
|
|
|
return Msg.fail("查询复杂,数据大,暂不支持只带sysId参数查询");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
|
|
|
|
&& sysId == null && hospitalId != null){
|
|
|
|
|
if (StringUtils.isBlank(sysFlag) && StringUtils.isBlank(userName) && userId == null && roleId == null
|
|
|
|
|
&& sysId == null && hospitalId != null) {
|
|
|
|
|
return Msg.fail("查询复杂,数据大,暂不支持只带hospitalId参数查询");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(userName)){
|
|
|
|
|
if (StringUtils.isNotBlank(userName)) {
|
|
|
|
|
List<Power_User> power_users = userMapper.checkUserName(userName);
|
|
|
|
|
if(null != power_users && !power_users.isEmpty()){
|
|
|
|
|
if(power_users.get(0).getRoleId().equals(0) || power_users.get(0).getRoleId().equals(-100)){
|
|
|
|
|
if (null != power_users && !power_users.isEmpty()) {
|
|
|
|
|
if (power_users.get(0).getRoleId().equals(0) || power_users.get(0).getRoleId().equals(-100)) {
|
|
|
|
|
roleId = power_users.get(0).getRoleId();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -104,59 +110,61 @@ public class FontController {
|
|
|
|
|
|
|
|
|
|
List<User_Dept_Menu> list = userDeptMenuService.selectAll(userName, sysFlag, userId, roleId, sysId, hospitalId);
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return Msg.success().add("list",list);
|
|
|
|
|
return Msg.success().add("list", list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.2
|
|
|
|
|
* @ProjectName: selectAllByUserIdOrRoleIdAndSysIdOrSysFlag
|
|
|
|
|
* @Description: 根据用户id或角色id和系统id或系统标识查询通知记录
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return selectAllByUserIdOrRoleIdAndSysIdOrSysFlag
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/29 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/29 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: selectAllByUserIdOrRoleIdAndSysIdOrSysFlag
|
|
|
|
|
* @Description: 根据用户id或角色id和系统id或系统标识查询通知记录
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return selectAllByUserIdOrRoleIdAndSysIdOrSysFlag
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/29 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/29 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "selectAllByUserIdOrRoleIdAndSysIdOrSysFlag")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg selectAllByUserIdOrRoleIdAndSysIdOrSysFlag(Integer userId,Integer roleId,Integer sysId,String sysFlag,String sysName,Integer effective,String noticeTitle,String noticeSend,String noticeDate,String noticeTypeFlag,String noticeTypeName) throws Exception{
|
|
|
|
|
List<Power_Notice> list = powerNoticeMapper.selectAllByUserIdOrRoleIdAndSysIdOrSysFlag(userId, roleId, sysId,sysFlag,sysName,effective,noticeTitle,noticeSend,noticeDate,noticeTypeFlag,noticeTypeName);
|
|
|
|
|
public Msg selectAllByUserIdOrRoleIdAndSysIdOrSysFlag(Integer userId, Integer roleId, Integer sysId, String sysFlag, String sysName, Integer effective, String noticeTitle, String noticeSend, String noticeDate, String noticeTypeFlag, String noticeTypeName) throws Exception {
|
|
|
|
|
List<Power_Notice> list = powerNoticeMapper.selectAllByUserIdOrRoleIdAndSysIdOrSysFlag(userId, roleId, sysId, sysFlag, sysName, effective, noticeTitle, noticeSend, noticeDate, noticeTypeFlag, noticeTypeName);
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return Msg.success().add("list",list);
|
|
|
|
|
return Msg.success().add("list", list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.4
|
|
|
|
|
* @ProjectName: getUserPowerTreeBySysFlag
|
|
|
|
|
* @Description: 获取系统用户树通过系统标识
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return PowerTree
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getUserPowerTreeBySysFlag
|
|
|
|
|
* @Description: 获取系统用户树通过系统标识
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return PowerTree
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getUserPowerTreeBySysFlag",produces = {"text/json;charset=UTF-8"})
|
|
|
|
|
@RequestMapping(value = "getUserPowerTreeBySysFlag", produces = {"text/json;charset=UTF-8"})
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getUserPowerTreeBySysFlag(String sysFlag,Integer userId){
|
|
|
|
|
public String getUserPowerTreeBySysFlag(String sysFlag, Integer userId) {
|
|
|
|
|
try {
|
|
|
|
|
if(null != userId){
|
|
|
|
|
if (null != userId) {
|
|
|
|
|
//查询该用户
|
|
|
|
|
Power_UserVo user = userMapper.selectByPrimaryKey(userId);
|
|
|
|
|
List<PowerTree> dicts = powerService.getUserPowerTreeBySysFlag(sysFlag,user);
|
|
|
|
|
List<PowerTree> dicts = powerService.getUserPowerTreeBySysFlag(sysFlag, user);
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
String json = mapper.writeValueAsString(dicts);
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return json;
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
CacheManager.addExcCount("exc");
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
ExceptionPrintUtil.printException(e);
|
|
|
|
@ -166,32 +174,33 @@ public class FontController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.5
|
|
|
|
|
* @ProjectName: getRolePowerTreeBySysFlag
|
|
|
|
|
* @Description: 获取系统角色树通过系统标识
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return PowerTree
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getRolePowerTreeBySysFlag
|
|
|
|
|
* @Description: 获取系统角色树通过系统标识
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return PowerTree
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/7/9 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getRolePowerTreeBySysFlag",produces = {"text/json;charset=UTF-8"})
|
|
|
|
|
@RequestMapping(value = "getRolePowerTreeBySysFlag", produces = {"text/json;charset=UTF-8"})
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getRolePowerTreeBySysFlag(String sysFlag,Integer userId){
|
|
|
|
|
public String getRolePowerTreeBySysFlag(String sysFlag, Integer userId) {
|
|
|
|
|
try {
|
|
|
|
|
if(null != userId){
|
|
|
|
|
if (null != userId) {
|
|
|
|
|
Power_UserVo user = userMapper.selectByPrimaryKey(userId);
|
|
|
|
|
List<PowerTree> dicts = powerService.getRolePowerTreeBySysFlag(sysFlag,user);
|
|
|
|
|
List<PowerTree> dicts = powerService.getRolePowerTreeBySysFlag(sysFlag, user);
|
|
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
|
|
String json = mapper.writeValueAsString(dicts);
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return json;
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
CacheManager.addExcCount("exc");
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
ExceptionPrintUtil.printException(e);
|
|
|
|
@ -201,60 +210,62 @@ public class FontController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.6
|
|
|
|
|
* @ProjectName: getUserList
|
|
|
|
|
* @Description: 获取用户id和用户名
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return userList
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/9/6 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/9/6 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getUserList
|
|
|
|
|
* @Description: 获取用户id和用户名
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return userList
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/9/6 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/9/6 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getUserList")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg getUserList(String userName) throws Exception{
|
|
|
|
|
public Msg getUserList(String userName) throws Exception {
|
|
|
|
|
List<User> list = new ArrayList<>();
|
|
|
|
|
if(StringUtils.isNoneBlank(userName)){
|
|
|
|
|
if (StringUtils.isNoneBlank(userName)) {
|
|
|
|
|
List<Power_User> users = userMapper.checkUserName(userName);
|
|
|
|
|
if(null != users && !users.isEmpty()){
|
|
|
|
|
if (null != users && !users.isEmpty()) {
|
|
|
|
|
Integer roleId = users.get(0).getRoleId();
|
|
|
|
|
if(roleId == 0){
|
|
|
|
|
if (roleId == 0) {
|
|
|
|
|
list = userMapper.selectUserIdAndUserNameList(null);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
list = userMapper.selectUserIdAndUserNameList(users.get(0).getUserId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return Msg.fail("用户名不能为空");
|
|
|
|
|
}
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return Msg.success().add("userList",list);
|
|
|
|
|
return Msg.success().add("userList", list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.7
|
|
|
|
|
* @ProjectName: checkToken
|
|
|
|
|
* @Description: 验证token是否有效
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return Msg
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/9/24 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/9/24 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: checkToken
|
|
|
|
|
* @Description: 验证token是否有效
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return Msg
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/9/24 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/9/24 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "checkToken",method = RequestMethod.POST)
|
|
|
|
|
@RequestMapping(value = "checkToken", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg checkToken(String token) throws Exception{
|
|
|
|
|
if(StringUtils.isNotBlank(token) && StringUtils.isNotBlank(token) ) {
|
|
|
|
|
public Msg checkToken(String token) throws Exception {
|
|
|
|
|
if (StringUtils.isNotBlank(token) && StringUtils.isNotBlank(token)) {
|
|
|
|
|
Cache cache = CacheManager.getCacheInfo(token);
|
|
|
|
|
if (cache == null) {
|
|
|
|
|
return Msg.fail("token已过期或不存在");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return Msg.fail("token不能为空");
|
|
|
|
|
}
|
|
|
|
|
return Msg.success();
|
|
|
|
@ -262,33 +273,34 @@ public class FontController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.8
|
|
|
|
|
* @ProjectName: getUserByToken
|
|
|
|
|
* @Description: 根据token获取用户
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return getMenuListByToken
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getUserByToken
|
|
|
|
|
* @Description: 根据token获取用户
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return getMenuListByToken
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getUserByToken",method = RequestMethod.POST)
|
|
|
|
|
@RequestMapping(value = "getUserByToken", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg getMenuListByToken(String token,String sysFlag) throws Exception{
|
|
|
|
|
if(StringUtils.isBlank(token)){
|
|
|
|
|
public Msg getMenuListByToken(String token, String sysFlag) throws Exception {
|
|
|
|
|
if (StringUtils.isBlank(token)) {
|
|
|
|
|
return Msg.fail("token不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(sysFlag)){
|
|
|
|
|
if (StringUtils.isBlank(sysFlag)) {
|
|
|
|
|
return Msg.fail("sysFlag不能为空!");
|
|
|
|
|
}
|
|
|
|
|
Cache cacheInfo = CacheManager.getCacheInfo(token);
|
|
|
|
|
Power_UserVo user = (Power_UserVo) cacheInfo.getValue();
|
|
|
|
|
if(null != user){
|
|
|
|
|
if (null != user) {
|
|
|
|
|
List<User_Dept_Menu> menuList = user.getMenuList();
|
|
|
|
|
List<User_Dept_Menu> list = new ArrayList<>();
|
|
|
|
|
Set<String> menus = new TreeSet<>();
|
|
|
|
|
if(null != menuList && !menuList.isEmpty()){
|
|
|
|
|
if (null != menuList && !menuList.isEmpty()) {
|
|
|
|
|
for (User_Dept_Menu user_dept_menu : menuList) {
|
|
|
|
|
String menuSysFlag = user_dept_menu.getSysFlag();
|
|
|
|
|
if (StringUtils.isNotBlank(menuSysFlag) && menuSysFlag.equals(sysFlag)) {
|
|
|
|
@ -302,51 +314,52 @@ public class FontController {
|
|
|
|
|
user.setMenuList(list);
|
|
|
|
|
user.setMenus(menus);
|
|
|
|
|
UserVo userVo = new UserVo();
|
|
|
|
|
BeanUtils.copyProperties(user,userVo);
|
|
|
|
|
BeanUtils.copyProperties(user, userVo);
|
|
|
|
|
//查询用户集合
|
|
|
|
|
List<User> userList = new ArrayList<>();
|
|
|
|
|
Integer roleId = userVo.getRoleId();
|
|
|
|
|
if(roleId == 0){
|
|
|
|
|
if (roleId == 0) {
|
|
|
|
|
userList = userMapper.selectUserIdAndUserNameList(null);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
userList = userMapper.selectUserIdAndUserNameList(userVo.getUserId());
|
|
|
|
|
}
|
|
|
|
|
//设置用户集合
|
|
|
|
|
userVo.setUserList(userList);
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return Msg.success().add("user",userVo);
|
|
|
|
|
}else{
|
|
|
|
|
return Msg.success().add("user", userVo);
|
|
|
|
|
} else {
|
|
|
|
|
return Msg.fail("token已失效");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.9
|
|
|
|
|
* @ProjectName: getMenuByToken
|
|
|
|
|
* @Description: 根据token获取菜单
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return getMenuListByToken
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getMenuByToken
|
|
|
|
|
* @Description: 根据token获取菜单
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return getMenuListByToken
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/10/31 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getMenuByToken",method = RequestMethod.POST)
|
|
|
|
|
@RequestMapping(value = "getMenuByToken", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg getMenuByToken(String token,String sysFlag) throws Exception{
|
|
|
|
|
if(StringUtils.isBlank(token)){
|
|
|
|
|
public Msg getMenuByToken(String token, String sysFlag) throws Exception {
|
|
|
|
|
if (StringUtils.isBlank(token)) {
|
|
|
|
|
return Msg.fail("token不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(sysFlag)){
|
|
|
|
|
if (StringUtils.isBlank(sysFlag)) {
|
|
|
|
|
return Msg.fail("sysFlag不能为空!");
|
|
|
|
|
}
|
|
|
|
|
Cache cacheInfo = CacheManager.getCacheInfo(token);
|
|
|
|
|
Power_UserVo user = (Power_UserVo) cacheInfo.getValue();
|
|
|
|
|
List<User_Dept_Menu> menuList = user.getMenuList();
|
|
|
|
|
List<User_Dept_Menu> list = new ArrayList<>();
|
|
|
|
|
if(null != menuList && !menuList.isEmpty()){
|
|
|
|
|
if (null != menuList && !menuList.isEmpty()) {
|
|
|
|
|
for (User_Dept_Menu user_dept_menu : menuList) {
|
|
|
|
|
String menuSysFlag = user_dept_menu.getSysFlag();
|
|
|
|
|
if (StringUtils.isNotBlank(menuSysFlag) && menuSysFlag.equals(sysFlag)) {
|
|
|
|
@ -355,36 +368,37 @@ public class FontController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return Msg.success().add("list",list);
|
|
|
|
|
return Msg.success().add("list", list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.10
|
|
|
|
|
* @ProjectName: getToken
|
|
|
|
|
* @Description: 获取token
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return Msg
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/11/06 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/11/06 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*
|
|
|
|
|
* @ProjectName: getToken
|
|
|
|
|
* @Description: 获取token
|
|
|
|
|
* @Param 无
|
|
|
|
|
* @Return Msg
|
|
|
|
|
* @Author: 曾文和
|
|
|
|
|
* @CreateDate: 2019/11/06 10:00
|
|
|
|
|
* @UpdateUser: 更新者
|
|
|
|
|
* @UpdateDate: 2019/11/06 10:00
|
|
|
|
|
* @UpdateRemark: 更新说明
|
|
|
|
|
* @Version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getToken",method = RequestMethod.POST)
|
|
|
|
|
@RequestMapping(value = "getToken", method = RequestMethod.POST)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg getToken(String userName,String password) throws Exception{
|
|
|
|
|
if(StringUtils.isBlank(userName)){
|
|
|
|
|
public Msg getToken(String userName, String password) throws Exception {
|
|
|
|
|
if (StringUtils.isBlank(userName)) {
|
|
|
|
|
return Msg.fail("用户名不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(password)){
|
|
|
|
|
if (StringUtils.isBlank(password)) {
|
|
|
|
|
return Msg.fail("密码不能为空");
|
|
|
|
|
}
|
|
|
|
|
Power_User user = new Power_User();
|
|
|
|
|
user.setUserName(userName);
|
|
|
|
|
user.setRemark(password);
|
|
|
|
|
Power_UserVo userVo = userService.findPowerUserByUserNameAndRemark(user);
|
|
|
|
|
if(null == userVo){
|
|
|
|
|
if (null == userVo) {
|
|
|
|
|
return Msg.fail("用户名或密码不正确");
|
|
|
|
|
}
|
|
|
|
|
String date = String.valueOf(DateUtils.getDate());
|
|
|
|
@ -394,11 +408,11 @@ public class FontController {
|
|
|
|
|
List<User_Dept_Menu> menuList = new ArrayList<>();
|
|
|
|
|
Set<String> menus = new TreeSet<>();
|
|
|
|
|
if (userVo.getRoleId().equals(0) || userVo.getRoleId().equals(-100)) {
|
|
|
|
|
list = powerMenuService.queryAllPowerMenu(null,userVo.getRoleId());
|
|
|
|
|
list = powerMenuService.queryAllPowerMenu(null, userVo.getRoleId());
|
|
|
|
|
} else {
|
|
|
|
|
list = powerMenuService.selectUserAndRoleMenuListPower(userVo.getUserId(),null);
|
|
|
|
|
list = powerMenuService.selectUserAndRoleMenuListPower(userVo.getUserId(), null);
|
|
|
|
|
}
|
|
|
|
|
if(null != list && !list.isEmpty()){
|
|
|
|
|
if (null != list && !list.isEmpty()) {
|
|
|
|
|
for (Power_Menu power_menu : list) {
|
|
|
|
|
User_Dept_Menu deptMenu = new User_Dept_Menu();
|
|
|
|
|
String menuUrl = power_menu.getMenuUrl();
|
|
|
|
@ -418,22 +432,23 @@ public class FontController {
|
|
|
|
|
//设置科室
|
|
|
|
|
StringBuilder power_depts = new StringBuilder();
|
|
|
|
|
List<Power_Dept> power_depts1 = power_deptService.selectByPrimaryKeys(userVo.getDeptId());
|
|
|
|
|
for(int j=0;j<power_depts1.size();j++){
|
|
|
|
|
if(j<power_depts1.size()-1){
|
|
|
|
|
for (int j = 0; j < power_depts1.size(); j++) {
|
|
|
|
|
if (j < power_depts1.size() - 1) {
|
|
|
|
|
power_depts.append(power_depts1.get(j).getDeptName()).append(",");
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
power_depts.append(power_depts1.get(j).getDeptName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userVo.setRemark(power_depts.toString());
|
|
|
|
|
//移除缓存
|
|
|
|
|
CacheManager.removeCacheByObject(userVo);
|
|
|
|
|
CacheManager.putCache(token,new Cache(date,userVo,TOKEN_EXPIRE_TIME));
|
|
|
|
|
return Msg.success().add("token",token);
|
|
|
|
|
CacheManager.putCache(token, new Cache(date, userVo, TOKEN_EXPIRE_TIME));
|
|
|
|
|
return Msg.success().add("token", token);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 2.11
|
|
|
|
|
*
|
|
|
|
|
* @MethodName getUnReadCount
|
|
|
|
|
* @Description: 根据用户获取未读通知数量
|
|
|
|
|
* @Param 无
|
|
|
|
@ -447,17 +462,17 @@ public class FontController {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("notice/getUnReadCount")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg getUnReadCount(Integer userId) throws Exception{
|
|
|
|
|
if(null == userId){
|
|
|
|
|
public Msg getUnReadCount(Integer userId) throws Exception {
|
|
|
|
|
if (null == userId) {
|
|
|
|
|
return Msg.fail("用户id不能为空");
|
|
|
|
|
}
|
|
|
|
|
Power_UserVo userVo = userMapper.selectByPrimaryKey(userId);
|
|
|
|
|
if(null == userVo){
|
|
|
|
|
if (null == userVo) {
|
|
|
|
|
return Msg.fail("用户id不存在");
|
|
|
|
|
}
|
|
|
|
|
int unReadCount = noticeService.getUnReadCount(userId);
|
|
|
|
|
CacheManager.addExcCount("noExc");
|
|
|
|
|
return Msg.success().add("unReadCount",unReadCount);
|
|
|
|
|
return Msg.success().add("unReadCount", unReadCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -474,16 +489,16 @@ public class FontController {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("checkUserName")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg checkUserName(String userName) throws Exception{
|
|
|
|
|
if(StringUtils.isBlank(userName)){
|
|
|
|
|
public Msg checkUserName(String userName) throws Exception {
|
|
|
|
|
if (StringUtils.isBlank(userName)) {
|
|
|
|
|
return Msg.fail("工号不能为空!");
|
|
|
|
|
}
|
|
|
|
|
//查询用户
|
|
|
|
|
List<Power_User> user = userMapper.checkUserName(userName);
|
|
|
|
|
if(null == user || user.isEmpty()){
|
|
|
|
|
if (null == user || user.isEmpty()) {
|
|
|
|
|
return Msg.fail("该工号不存在!");
|
|
|
|
|
}
|
|
|
|
|
return Msg.success().add("user",user);
|
|
|
|
|
return Msg.success().add("user", user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -501,19 +516,19 @@ public class FontController {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("sendEmrRecordApproveNotice")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void sendEmrRecordApproveNotice(String applyType,Integer count){
|
|
|
|
|
public void sendEmrRecordApproveNotice(String applyType, Integer count) {
|
|
|
|
|
try {
|
|
|
|
|
String title = "待审批通知";
|
|
|
|
|
String content = "您有"+count+"份"+applyType+"待审批!";
|
|
|
|
|
String content = "您有" + count + "份" + applyType + "待审批!";
|
|
|
|
|
//查询有借阅审批权限的id集合
|
|
|
|
|
String menuUrl = "/approve/updateApprove";
|
|
|
|
|
List<Power_User> users = userMapper.selectUserIdsWithApprove(menuUrl);
|
|
|
|
|
for(Power_User user : users){
|
|
|
|
|
if(null != user) {
|
|
|
|
|
for (Power_User user : users) {
|
|
|
|
|
if (null != user) {
|
|
|
|
|
WsPool.sendMessageToAll("emr_record_" + user.getUserId(), title + STR_SPLIT + content + STR_SPLIT + "emr_record");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ExceptionPrintUtil.printException(e);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@ -521,6 +536,7 @@ public class FontController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据当前登录用户工号获取所在科室编号
|
|
|
|
|
*
|
|
|
|
|
* @return String
|
|
|
|
|
* @throws Exception
|
|
|
|
|
* @CreateDate: 2021-08-30
|
|
|
|
@ -528,49 +544,110 @@ public class FontController {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getDeptCodeByUserName")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getDeptCodeByDeptId(Integer deptId) throws Exception{
|
|
|
|
|
public String getDeptCodeByDeptId(Integer deptId) throws Exception {
|
|
|
|
|
Power_Dept power_dept = power_deptService.selectByPrimaryKey(deptId);
|
|
|
|
|
return power_dept.getDeptCode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据病案deptcode,查询出所有符合的科主任,数据:用户id,用户名称,科室名称
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/getUserInfoByDeptCodeForChief",produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@RequestMapping(value = "/getUserInfoByDeptCodeForChief", produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getUserInfoByDeptCodeForChief(String DeptCode){
|
|
|
|
|
public String getUserInfoByDeptCodeForChief(String DeptCode) {
|
|
|
|
|
List<Power_User> power_users = power_userMapper.selectAllForChief(DeptCode);
|
|
|
|
|
String result = "";
|
|
|
|
|
for (int i = 0; i < power_users.size(); i++) {
|
|
|
|
|
Power_User power_user = power_users.get(i);
|
|
|
|
|
result=power_user.getUserId()+","+power_user.getUserName()+","+power_user.getName()+";";
|
|
|
|
|
result += power_user.getUserId() + "," + power_user.getUserName() + "," + power_user.getName() + ";";
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据病案deptcode,查询出所有符合的病案室用户,需要用户id,用户名称,科室名称
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/getUserInfoByDeptCodeForRecordRoom",produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@RequestMapping(value = "/getUserInfoByDeptCodeForRecordRoom", produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getUserInfoByDeptCodeForRecordRoom(String DeptCode){
|
|
|
|
|
List<Power_User> power_users = power_userMapper.selectAllForRecordRoom(DeptCode);
|
|
|
|
|
public String getUserInfoByDeptCodeForRecordRoom() {
|
|
|
|
|
List<Power_User> power_users = power_userMapper.selectAllForRecordRoom();
|
|
|
|
|
String result = "";
|
|
|
|
|
for (int i = 0; i < power_users.size(); i++) {
|
|
|
|
|
Power_User power_user = power_users.get(i);
|
|
|
|
|
result=power_user.getUserId()+","+power_user.getUserName()+","+power_user.getName()+";";
|
|
|
|
|
result += power_user.getUserId() + "," + power_user.getUserName() + "," + power_user.getName() + ";";
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据病案deptcode,查询出所有符合的每个用户,数据:用户id,用户名字,roleId
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/getUserInfoByDeptCodeForMedicalRecordCollection", produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getUserInfoByDeptCodeForMedicalRecordCollection(String deptCode) {
|
|
|
|
|
// 通过deptCode获取userId数组
|
|
|
|
|
List<Power_User> power_users = power_userMapper.selectAllUserInfo();
|
|
|
|
|
StringBuilder userALLInfo = new StringBuilder();
|
|
|
|
|
for (Power_User powerUser : power_users) {
|
|
|
|
|
String deptId = powerUser.getDeptId();
|
|
|
|
|
String[] userDeptId = deptId.split(",");
|
|
|
|
|
Integer roleId = powerUser.getRoleId();
|
|
|
|
|
for (int i = 0; i < userDeptId.length; i++) {
|
|
|
|
|
// 查询到deptId对应的deptCode
|
|
|
|
|
List<Power_Dept> powerDepts = powerDeptMapper.selectDeptCode(userDeptId[i]);
|
|
|
|
|
for (Power_Dept powerDept : powerDepts) {
|
|
|
|
|
if (deptCode.equals(powerDept.getDeptCode())) {
|
|
|
|
|
String oneDeptCodeResult = powerUser.getUserId() + "," + powerUser.getName() + ";";
|
|
|
|
|
if (roleId == 24 || roleId == 26 || roleId == 23 || roleId == 29) {
|
|
|
|
|
userALLInfo.append(oneDeptCodeResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return userALLInfo.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据病案deptcode,查询出所有符合的每个用户,数据:用户id,用户名字,roleId
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/getUserInfoByDeptCodeForAcquisitionCompleted", produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getUserInfoByDeptCodeForAcquisitionCompleted(String deptCode) {
|
|
|
|
|
// 通过deptCode获取userId数组
|
|
|
|
|
List<Power_User> power_users = power_userMapper.selectAllUserInfo();
|
|
|
|
|
StringBuilder userALLInfo = new StringBuilder();
|
|
|
|
|
for (Power_User powerUser : power_users) {
|
|
|
|
|
String deptId = powerUser.getDeptId();
|
|
|
|
|
String[] userDeptId = deptId.split(",");
|
|
|
|
|
Integer roleId = powerUser.getRoleId();
|
|
|
|
|
for (int i = 0; i < userDeptId.length; i++) {
|
|
|
|
|
// 查询到deptId对应的deptCode
|
|
|
|
|
List<Power_Dept> powerDepts = powerDeptMapper.selectDeptCode(userDeptId[i]);
|
|
|
|
|
for (Power_Dept powerDept : powerDepts) {
|
|
|
|
|
if (deptCode.equals(powerDept.getDeptCode())) {
|
|
|
|
|
String oneDeptCodeResult = powerUser.getUserId() + "," + powerUser.getName() + ";";
|
|
|
|
|
if (roleId == 24 || roleId == 26 || roleId == 23 || roleId == 29) {
|
|
|
|
|
userALLInfo.append(oneDeptCodeResult);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return userALLInfo.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过申请医生id,获取医生名字,
|
|
|
|
|
* 通过病案deptcode,获取医生对应的科室
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/getDoctorNameAndDoctorRoom",produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@RequestMapping(value = "/getDoctorNameAndDoctorRoom", produces = "text/plain;charset=UTF-8")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getDoctorNameAndDoctorRoom(String userId,String deptcode){
|
|
|
|
|
public String getDoctorNameAndDoctorRoom(String userId, String deptcode) {
|
|
|
|
|
String name = power_userMapper.selectForDoctorName(userId);
|
|
|
|
|
String room= power_userMapper.selectForDoctorRoom(deptcode);
|
|
|
|
|
String result = room+","+name;
|
|
|
|
|
String room = power_userMapper.selectForDoctorRoom(deptcode);
|
|
|
|
|
String result = room + "," + name;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -579,7 +656,7 @@ public class FontController {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getDoctorDeptcode")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getDoctorDeptcode(Integer userId){
|
|
|
|
|
public String getDoctorDeptcode(Integer userId) {
|
|
|
|
|
//获取deptId
|
|
|
|
|
String deptId = power_userMapper.selectForDeptId(userId);
|
|
|
|
|
//获取deptcode
|
|
|
|
@ -605,6 +682,45 @@ public class FontController {
|
|
|
|
|
return realName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 通过deptcode获取科室中文名称
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getDeptCodeByChinese")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getDeptCodeByChinese(String deptCode) {
|
|
|
|
|
//获取realName
|
|
|
|
|
String chineseName = powerDeptMapper.getDeptCodeByChinese(deptCode);
|
|
|
|
|
return chineseName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取所有用户的id、名字、deptcode、中文科室名字
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getAllUserInfo")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String getAllUserInfo() {
|
|
|
|
|
List<Power_User> power_users = power_userMapper.selectAllUserInfo();
|
|
|
|
|
String deptCode = "";
|
|
|
|
|
String deptName = "";
|
|
|
|
|
for (int i = 0; i < power_users.size(); i++) {
|
|
|
|
|
String deptId = power_users.get(i).getDeptId();
|
|
|
|
|
String[] deptIdOne = deptId.split(",");
|
|
|
|
|
for (int j = 0; j < deptIdOne.length; j++) {
|
|
|
|
|
List<Power_Dept> deptCodeAndDeptCodeChinese = powerDeptMapper.getDeptCodeAndDeptCodeChinese(deptIdOne[j]);
|
|
|
|
|
for (int k = 0; k < deptCodeAndDeptCodeChinese.size(); k++) {
|
|
|
|
|
String deptCodeOne = deptCodeAndDeptCodeChinese.get(k).getDeptCode();
|
|
|
|
|
deptCode += deptCodeOne + ",";
|
|
|
|
|
String deptNameOne = deptCodeAndDeptCodeChinese.get(k).getDeptName();
|
|
|
|
|
deptName += deptNameOne + ",";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
power_users.get(i).setDeptCode(deptCode);
|
|
|
|
|
power_users.get(i).setDeptId(deptName);
|
|
|
|
|
}
|
|
|
|
|
String json = JSON.toJSONString(power_users);
|
|
|
|
|
return json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从高明更新至湛江,2021/11/20
|
|
|
|
@ -615,19 +731,20 @@ public class FontController {
|
|
|
|
|
if (null == message.getUserId()) {
|
|
|
|
|
return Msg.fail("消息用户id不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(message.getSysFlag())){
|
|
|
|
|
if (StringUtils.isBlank(message.getSysFlag())) {
|
|
|
|
|
return Msg.fail("消息系统标识不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(message.getTitle())){
|
|
|
|
|
if (StringUtils.isBlank(message.getTitle())) {
|
|
|
|
|
return Msg.fail("消息标题不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(message.getContent())){
|
|
|
|
|
if (StringUtils.isBlank(message.getContent())) {
|
|
|
|
|
return Msg.fail("消息内容不能为空");
|
|
|
|
|
}
|
|
|
|
|
WsPool.sendMessageToAll(message.getSysFlag() + "_" + message.getUserId(), message.getTitle() + STR_SPLIT + message.getContent() + STR_SPLIT + message.getTypeFlag());
|
|
|
|
|
|
|
|
|
|
return Msg.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从高明更新至湛江,2021/11/20
|
|
|
|
|
* 修改为向特定用户发送信息
|
|
|
|
@ -637,17 +754,17 @@ public class FontController {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("sendMessageWithNew")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg sendMessageWithNew(Message message) throws Exception{
|
|
|
|
|
if(null == message.getUserId()){
|
|
|
|
|
public Msg sendMessageWithNew(Message message) throws Exception {
|
|
|
|
|
if (null == message.getUserId()) {
|
|
|
|
|
return Msg.fail("消息用户id不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(message.getSysFlag())){
|
|
|
|
|
if (StringUtils.isBlank(message.getSysFlag())) {
|
|
|
|
|
return Msg.fail("消息系统标识不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(message.getTitle())){
|
|
|
|
|
if (StringUtils.isBlank(message.getTitle())) {
|
|
|
|
|
return Msg.fail("消息标题不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(message.getContent())){
|
|
|
|
|
if (StringUtils.isBlank(message.getContent())) {
|
|
|
|
|
return Msg.fail("消息内容不能为空");
|
|
|
|
|
}
|
|
|
|
|
WsPool.sendMessageToAll(message.getSysFlag() + "_" + message.getUserId(), message.getTitle() + STR_SPLIT + message.getContent() + STR_SPLIT + message.getTypeFlag());
|
|
|
|
@ -655,5 +772,27 @@ public class FontController {
|
|
|
|
|
return Msg.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 从高明更新至湛江,2021/11/29
|
|
|
|
|
* 修改为向特定用户发送信息,不使用sysflag
|
|
|
|
|
* 特定用户科主任,病案室
|
|
|
|
|
* 科主任需要判定是否和病案的科室相符,
|
|
|
|
|
* 病案室直接发送未审核数量
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("sendMessageWithNewWithOutSysFlag")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Msg sendMessageWithNewWithOutSysFlag(Message message) throws Exception {
|
|
|
|
|
if (null == message.getUserId()) {
|
|
|
|
|
return Msg.fail("消息用户id不能为空");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(message.getTitle())) {
|
|
|
|
|
return Msg.fail("消息标题不能为空");
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(message.getContent())) {
|
|
|
|
|
return Msg.fail("消息内容不能为空");
|
|
|
|
|
}
|
|
|
|
|
WsPool.sendMessageToAll(message.getUserId().toString(), message.getTitle() + STR_SPLIT + message.getContent() + STR_SPLIT + message.getTypeFlag());
|
|
|
|
|
return Msg.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|