Commit 3eafcf6f authored by wzp's avatar wzp

修改bug

parent 958a09fb
......@@ -88,7 +88,7 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
ew.eq("is_deleted", 0);
ew.eq("name", organ.getName());
List<TOrgan> list = list(ew);
if (null != list && !list.isEmpty()) {
if (list != null&&list.size()>0&&list.get(0)!=null) {
throw new Exception("机构名称不能重复!");
}
}else {
......
......@@ -663,14 +663,14 @@ public class ChinaMobileRestApiController extends BaseController {
qw.eq("is_current", 1);
qw.select().orderByDesc("create_time");
List<TAppDirPic> currentDirList = appDirPicService.list(qw);
if (null != currentDirList && !currentDirList.isEmpty()) {
if (currentDirList != null && currentDirList.size() > 0) {
currentDir = currentDirList.get(0);
}
QueryWrapper<TAppRunPic> qw1 = new QueryWrapper<>();
qw1.eq("is_current", 1);
qw1.select().orderByDesc("create_time");
List<TAppRunPic> currentRunList = appRunPicService.list(qw1);
if (null != currentDirList && !currentDirList.isEmpty()) {
if (currentRunList != null && currentRunList.size() > 0) {
currentRun = currentRunList.get(0);
}
......
......@@ -64,7 +64,7 @@ public class TOrganController extends BaseController {
ew.eq("is_deleted", 0);
ew.eq("name", organ.getName());
List<TOrgan> list = this.tOrganService.list(ew);
if (null != list && !list.isEmpty()) {
if (list != null && list.size()>0&&list.get(0)!=null) {
resultMap.put("resultCode", "400");
resultMap.put("message", "机构名称不能重复!");
return resultMap;
......
......@@ -173,7 +173,7 @@ public class TUserController extends BaseController {
try {
TUser tUser = userService.selectById(id);
List<Role> list = roleService.selectRoleByUserId(id);
if (null != list && !list.isEmpty()) {
if (list != null && list.size()>0&&list.get(0)!=null) {
List<String> list1 = new ArrayList<>();
list.forEach(r -> list1.add(r.getId()));
tUser.setRoleList(list1);
......@@ -325,7 +325,7 @@ public class TUserController extends BaseController {
ew.eq("type", "3");
ew.eq("org_id", user.getOrgId());
List<TUser> list = this.userService.list(ew);
if (null != list && !list.isEmpty()) {
if (list != null && list.size()>0&&list.get(0)!=null) {
resultMap.put("resultCode", "400");
resultMap.put("message", "每个单位只能有一个机顶盒账号!");
return resultMap;
......@@ -349,14 +349,16 @@ public class TUserController extends BaseController {
// user.setRealName(StringUtils.trimToNull(user.getRealName()));
user.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
ret = userService.updateById(user);
//查询当前用户拥有的角色
QueryWrapper<TUserRole> userRoleWrapper = new QueryWrapper<>();
userRoleWrapper.eq("user_id", user.getId());
boolean remove = tUserRoleService.remove(userRoleWrapper);
List<String> list = user.getRoleList();
if (null != list && !list.isEmpty()) {
if (null != list && list.size()>0&&list.get(0)!=null) {
//查询当前用户拥有的角色
QueryWrapper<TUserRole> userRoleWrapper = new QueryWrapper<>();
userRoleWrapper.eq("user_id", user.getId());
boolean remove = tUserRoleService.remove(userRoleWrapper);
ArrayList<TUserRole> list1 = new ArrayList<>();
for (String r : list) {
TUserRole userRole = new TUserRole();
......@@ -670,7 +672,7 @@ public class TUserController extends BaseController {
ew.eq("type", "3");
ew.eq("org_id", user.getOrgId());
List<TUser> list = this.userService.list(ew);
if (list != null && !list.isEmpty()) {
if (list != null && list.size()>0&&list.get(0)!=null) {
resultMap.put("resultCode", "400");
resultMap.put("message", "该单位机顶盒账号已存在!");
return resultMap;
......
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