Commit d53cf35f authored by licc's avatar licc

新增数据判空处理

parent 855c9d0e
...@@ -63,15 +63,25 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, Users> implements ...@@ -63,15 +63,25 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, Users> implements
//获取用户统计数据 //获取用户统计数据
UserData userData = userDataMapper.getByUserId(userId); UserData userData = userDataMapper.getByUserId(userId);
userVo.setRealName(userData.getRealName()); userVo.setRealName(userData.getRealName());
if (null != userData.getBuyTotal()) {
userVo.setBuyTotal(userData.getBuyTotal().toString()); userVo.setBuyTotal(userData.getBuyTotal().toString());
}
userVo.setBottom(userData.getBottom()); userVo.setBottom(userData.getBottom());
userVo.setIdNumber(userData.getIdNumber()); userVo.setIdNumber(userData.getIdNumber());
userVo.setPhone(userData.getPhone()); userVo.setPhone(userData.getPhone());
userVo.setRank(userData.getRank()); userVo.setRank(userData.getRank());
if (null != userData.getSaleTotal()) {
userVo.setSaleTotal(userData.getSaleTotal().toString()); userVo.setSaleTotal(userData.getSaleTotal().toString());
}
userVo.setTotalPeople(userData.getTotalPeople()); userVo.setTotalPeople(userData.getTotalPeople());
if (null != userData.getTotalRecharge()) {
userVo.setTotalRecharge(userData.getTotalRecharge().toString()); userVo.setTotalRecharge(userData.getTotalRecharge().toString());
}
if (null != userData.getTotalWithdrawal()) {
userVo.setTotalWithdrawal(userData.getTotalWithdrawal().toString()); userVo.setTotalWithdrawal(userData.getTotalWithdrawal().toString());
}
List<UserVo> list = new ArrayList<>(); List<UserVo> list = new ArrayList<>();
list.add(userVo); list.add(userVo);
return R.ok(list); return R.ok(list);
......
...@@ -17,7 +17,7 @@ spring: ...@@ -17,7 +17,7 @@ spring:
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
# 环境 dev|test|prod # 环境 dev|test|prod
profiles: profiles:
active: prod active: dev
# jackson时间格式化 # jackson时间格式化
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
......
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