Commit 752aff90 authored by licc's avatar licc

修改代码格式

parent b2745fc2
......@@ -25,20 +25,20 @@ public class AccountSerivceImpl implements AccountSerivce {
log.info("AccountSerivceImpl[].getAccountInfo[].input.param:userName,password"+userName,password);
//创建参数容器map
HashMap<String, Object> map = new HashMap<>(4);
//将参数放入容器中
map.put("userName",userName);
//查询管理者信息
AccountInfo accountInfo = accountMapper.getAccountInfo(map);
//判断信息是否查询成功
if (null==accountInfo) {
//查询失败抛出异常
return R.error("用户不存在");
}
//将加密过后的密码与传输数据进行比较
String s = Md5Util.digestMD5(accountInfo.getPassword());
if (!password.equals(s)) {
return R.error("密码或者用户名错误");
}
//查询超过则进行数据copy
AccountDto accountDto = new AccountDto();
BeanUtils.copyProperties(accountInfo,accountDto);
......
package cn.wisenergy.service.app.impl;
import cn.wisenergy.common.constant.CommonAttributes;
import cn.wisenergy.common.utils.Md5Util;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.mapper.ScoreInfoMapper;
import cn.wisenergy.mapper.UsersMapper;
......@@ -17,7 +16,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -51,8 +49,8 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen
pageHandle(queryVo);
//创建参数容器
HashMap<String, Object> map = new HashMap<>(4);
//将参数放入容器中
map.put("userQueryVo",queryVo);
//查询用户数据
List<UserInfo> list1 = usersMapper.getList(map);
int total = 0;
......@@ -61,15 +59,17 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen
for (UserInfo userInfo : list1) {
//创建UserInfoDto返回对象
UserInfoDto userInfoDto = new UserInfoDto();
//查询成绩信息
ScoreInfo scoreInfo = scoreInfoMapper.getById(userInfo.getId());
//将消息进行同步
BeanUtils.copyProperties(userInfo,userInfoDto);
userInfoDto.setCultureGrade(scoreInfo.getCultureGrade());
userInfoDto.setMajorGrade(scoreInfo.getMajorGrade());
userInfoDto.setRegisterTime(userInfo.getCreateTime());
//将userInfoDto装入集合中
list.add(userInfoDto);
//统计数据总量
total+=1;
}
......
......@@ -36,10 +36,6 @@ public class UserController {
log.info("UserController[].manageUser[].input.param:queryV0:{}"+queryVo);
//查询用户信息
R<PageInfo<UserInfoDto>> userList = userService.getUserList(queryVo);
System.out.println(userList);
if (null==userList||userList.getData().getList().size()==0) {
return R.error("展时还没有用户");
}
//返回数据
return R.ok(userList);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment