联系人组获取用户信息方式修改
规则管理无法存入json内容修改 用户查询接口修改返回结果
This commit is contained in:
parent
e29aa15a26
commit
805e34dd4d
|
@ -7,8 +7,11 @@ import org.jeecg.common.api.vo.Result;
|
|||
import org.jeecg.modules.entity.SysServer;
|
||||
import org.jeecg.modules.service.ISysServerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sysServer")
|
||||
@Api(value = "服务器配置信息管理", tags = "服务器配置信息管理")
|
||||
|
@ -47,4 +50,10 @@ public class SysServerController {
|
|||
return sysServerService.deleteById(id);
|
||||
}
|
||||
|
||||
@GetMapping("findAlarmHistory")
|
||||
public Result findAlarmHistory(String serverId,
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,@DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime){
|
||||
return sysServerService.findAlarmHistory(serverId, startTime, endTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import org.jeecg.common.api.QueryRequest;
|
|||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.modules.entity.SysServer;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface ISysServerService extends IService<SysServer> {
|
||||
|
||||
Result findPage(QueryRequest queryRequest, SysServer sysServer);
|
||||
|
@ -17,4 +19,6 @@ public interface ISysServerService extends IService<SysServer> {
|
|||
|
||||
Result deleteById(String id);
|
||||
|
||||
Result findAlarmHistory(String serverId, Date startTime, Date endTime);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import org.jeecg.modules.entity.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISysUserService extends IService<SysUser> {
|
||||
|
||||
List<SysUser> findUserList();
|
||||
Map<String ,SysUser> findUserList();
|
||||
|
||||
}
|
||||
|
|
|
@ -22,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("alarmContactGroupService")
|
||||
|
@ -42,7 +39,7 @@ public class AlarmContactGroupServiceImpl extends ServiceImpl<AlarmContactGroupM
|
|||
public Result findPage(QueryRequest queryRequest, AlarmContactGroup alarmContactGroup) {
|
||||
Result result = new Result();
|
||||
//获取用户信息
|
||||
List<SysUser> userList = sysUserService.findUserList();
|
||||
Map<String ,SysUser> userList = sysUserService.findUserList();
|
||||
Page<AlarmContactGroupVo> page = new Page<>();
|
||||
LambdaQueryWrapper<AlarmContactGroupVo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<AlarmContactGroupVo> alarmContactGroupVoPage = alarmContactGroupVoMapper.selectPage(page, queryWrapper);
|
||||
|
@ -59,9 +56,9 @@ public class AlarmContactGroupServiceImpl extends ServiceImpl<AlarmContactGroupM
|
|||
List<String> userIds = contactGroupMembers.stream().map(AlarmContactGroupMember::getUserId).collect(Collectors.toList());
|
||||
//根据用户id获得对应的用户信息
|
||||
if (CollectionUtils.isNotEmpty(userList)){
|
||||
for (SysUser user:userList) {
|
||||
if (userIds.contains(user.getId())){
|
||||
sysUsers.add(user);
|
||||
for (String userId:userIds) {
|
||||
if (userList.containsKey(userId)){
|
||||
sysUsers.add(userList.get(userId));
|
||||
}
|
||||
}
|
||||
item.setUsers(sysUsers);
|
||||
|
@ -76,7 +73,6 @@ public class AlarmContactGroupServiceImpl extends ServiceImpl<AlarmContactGroupM
|
|||
@Override
|
||||
public Result findInfo(String id) {
|
||||
Result result = new Result();
|
||||
List<SysUser> sysUsers = new LinkedList<>();
|
||||
//根据id查询对应的数据 判断数据是否在数据库中
|
||||
LambdaQueryWrapper<AlarmContactGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AlarmContactGroup::getId, id);
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import org.jeecg.common.api.QueryRequest;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
|
@ -58,6 +61,10 @@ public class AlarmRuleServiceImpl extends ServiceImpl<AlarmRuleMapper, AlarmRule
|
|||
alarmRule.setId(id.toString());
|
||||
alarmRule.setCreateTime(new Date());
|
||||
alarmRule.setCreateBy(username);
|
||||
if (StringUtils.isNotBlank(alarmRule.getOperator())){
|
||||
String jsonString = JSON.toJSONString(alarmRule.getOperator());
|
||||
alarmRule.setOperator(jsonString);
|
||||
}
|
||||
this.baseMapper.insert(alarmRule);
|
||||
result.setSuccess(true);
|
||||
result.success("新增成功");
|
||||
|
@ -80,6 +87,10 @@ public class AlarmRuleServiceImpl extends ServiceImpl<AlarmRuleMapper, AlarmRule
|
|||
}
|
||||
alarmRule.setUpdateTime(new Date());
|
||||
alarmRule.setUpdateBy(username);
|
||||
if (StringUtils.isNotBlank(alarmRule.getOperator())){
|
||||
String jsonString = JSON.toJSONString(alarmRule.getOperator());
|
||||
alarmRule.setOperator(jsonString);
|
||||
}
|
||||
this.baseMapper.updateById(alarmRule);
|
||||
result.setSuccess(true);
|
||||
result.success("修改成功");
|
||||
|
|
|
@ -106,4 +106,10 @@ public class SysServerServiceImpl extends ServiceImpl<SysServerMapper, SysServer
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result findAlarmHistory(String serverId, Date startTime, Date endTime) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,8 +13,10 @@ import org.jeecg.modules.service.ISysUserService;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service("sysUserService")
|
||||
|
@ -26,7 +28,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
private SysRoleMapper sysRoleMapper;
|
||||
|
||||
@Override
|
||||
public List<SysUser> findUserList() {
|
||||
public Map<String ,SysUser> findUserList() {
|
||||
Map<String ,SysUser> map = new HashMap<>();
|
||||
LambdaQueryWrapper<SysUser> userQueryWrapper = new LambdaQueryWrapper<>();
|
||||
List<SysUser> sysUsers = this.baseMapper.selectList(userQueryWrapper);
|
||||
LambdaQueryWrapper<SysUserRole> userRoleQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -48,10 +51,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
}
|
||||
}
|
||||
}
|
||||
sysUser.setRoles(roles);
|
||||
}
|
||||
sysUser.setRoles(roles);
|
||||
map.put(sysUser.getId(), sysUser);
|
||||
}
|
||||
}
|
||||
return sysUsers;
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user