|
@@ -24,6 +24,8 @@ import com.factory.user.mapper.UserInfoMapper;
|
|
|
import com.factory.user.mapper.UserRoleMapper;
|
|
|
import com.factory.user.service.UserInfoService;
|
|
|
import com.factory.user.util.Base64;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -50,7 +52,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
}
|
|
|
UserInfo userInfo = getById(id);
|
|
|
if (userInfo != null) {
|
|
|
- name = userInfo.getName();
|
|
|
+ name = StringUtils.isBlank(userInfo.getName())?userInfo.getUsername():userInfo.getName();
|
|
|
}
|
|
|
return name;
|
|
|
}
|
|
@@ -81,6 +83,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
UserRes userRes = new UserRes();
|
|
|
userRes.setId(x.getId());
|
|
|
userRes.setUsername(x.getUsername());
|
|
|
+ userRes.setName(x.getName());
|
|
|
List<UserRole> userRoles = userRoleMapper.selectList(Wrappers.<UserRole>lambdaQuery().eq(UserRole::getUserId, x.getId()));
|
|
|
if (CollUtil.isNotEmpty(userRoles)) {
|
|
|
Role role = roleMapper.selectById(userRoles.get(0).getRoleId());
|
|
@@ -121,6 +124,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
String psd = Base64.encode(userInsertReq.getPassword().getBytes());
|
|
|
userInfo.setPassword(psd);
|
|
|
userInfo.setEffectiveTime(LocalDateTime.now());
|
|
|
+ userInfo.setName(userInsertReq.getName());
|
|
|
if (userInsertReq.getShiftId() != null) {
|
|
|
userInfo.setShiftId(userInsertReq.getShiftId());
|
|
|
}
|
|
@@ -158,6 +162,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
|
|
|
if (userInsertReq.getShiftId() != null) {
|
|
|
userInfo.setShiftId(userInsertReq.getShiftId());
|
|
|
}
|
|
|
+ userInfo.setName(userInsertReq.getName());
|
|
|
userInfo.setId(userInsertReq.getId());
|
|
|
int up = baseMapper.updateById(userInfo);
|
|
|
if (up > 0) {
|