Browse Source

Merge remote-tracking branch 'origin/dev_grid_patrol' into develop

dev_shibei_match
zxc 4 years ago
parent
commit
c4fdf63bb5
  1. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java
  2. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  3. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map;
/** /**
* @Author zxc * @Author zxc
@ -30,6 +31,6 @@ public class CustomerAgencyUserRoleDTO implements Serializable {
/** /**
* 角色 * 角色
*/ */
private String roles; private Map roles;
} }

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -339,7 +339,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
roleKeyValue.forEach(r -> { roleKeyValue.forEach(r -> {
m.put(r.getRoleKey(),r.getRoleName()); m.put(r.getRoleKey(),r.getRoleName());
}); });
dto.setRoles(m.toString()); dto.setRoles(m);
staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto);
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
} }
@ -412,7 +412,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
roleKeyValue.forEach(r -> { roleKeyValue.forEach(r -> {
m.put(r.getRoleKey(),r.getRoleName()); m.put(r.getRoleKey(),r.getRoleName());
}); });
dto.setRoles(m.toString()); dto.setRoles(m);
staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto);
return new Result(); return new Result();
} }

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -17,6 +17,8 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.entity.DataScope;
@ -228,7 +230,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
rolesByDB.forEach(l -> { rolesByDB.forEach(l -> {
map.put(l.getRoleKey(), l.getRoleName()); map.put(l.getRoleKey(), l.getRoleName());
}); });
dto.setRoles(map.toString()); dto.setRoles(map);
staffRoleRedis.setRole(customerId, staffId, dto); staffRoleRedis.setRole(customerId, staffId, dto);
return dto; return dto;
} }
@ -259,7 +261,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
list.forEach(l -> { list.forEach(l -> {
map.put(l.getRoleKey(), l.getRoleName()); map.put(l.getRoleKey(), l.getRoleName());
}); });
dto.setRoles(map.toString()); dto.setRoles(map);
staffRoleRedis.setRole(customerId, userId, dto); staffRoleRedis.setRole(customerId, userId, dto);
}); });
} }

Loading…
Cancel
Save