|
|
@ -24,8 +24,10 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.CustomerStaffConstant; |
|
|
|
import com.epmet.constant.UserConstant; |
|
|
@ -39,6 +41,7 @@ import com.epmet.entity.CustomerStaffEntity; |
|
|
|
import com.epmet.entity.GovStaffRoleEntity; |
|
|
|
import com.epmet.entity.StaffRoleEntity; |
|
|
|
import com.epmet.entity.UserEntity; |
|
|
|
import com.epmet.feign.AuthFeignClient; |
|
|
|
import com.epmet.redis.CustomerStaffRedis; |
|
|
|
import com.epmet.service.CustomerStaffService; |
|
|
|
import com.epmet.service.GovStaffRoleService; |
|
|
@ -52,10 +55,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
@ -78,6 +78,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
private StaffRoleService staffRoleService; |
|
|
|
@Autowired |
|
|
|
private StaffRoleDao staffRoleDao; |
|
|
|
@Autowired |
|
|
|
private CpUserDetailRedis cpUserDetailRedis; |
|
|
|
@Autowired |
|
|
|
private AuthFeignClient authFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<CustomerStaffDTO> page(Map<String, Object> params) { |
|
|
@ -328,6 +332,23 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
staffRoleEntity.setOrgId(fromDTO.getAgencyId()); |
|
|
|
staffRoleService.insert(staffRoleEntity); |
|
|
|
}); |
|
|
|
|
|
|
|
// redis缓存角色修改
|
|
|
|
UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO(); |
|
|
|
updateRolesForm.setOrgId(fromDTO.getAgencyId()); |
|
|
|
updateRolesForm.setStaffId(fromDTO.getStaffId()); |
|
|
|
updateRolesForm.setRoleIds(fromDTO.getRoles()); |
|
|
|
try { |
|
|
|
Result result = authFeignClient.updateCachedRoles(updateRolesForm); |
|
|
|
if (!result.success()) { |
|
|
|
logger.error("修改用户信息:修改用户已缓存的角色列表失败:{}", result.getInternalMsg()); |
|
|
|
} |
|
|
|
logger.info("修改用户信息:修改用户已缓存的角色列表成功"); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("修改用户信息:修改用户已缓存的角色列表异常:{}", ExceptionUtils.getErrorStackTrace(e));; |
|
|
|
} |
|
|
|
|
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|