diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index e52b9441ae..07c8e2b306 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -51,6 +51,7 @@ import com.epmet.feign.AuthFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.CustomerStaffRedis; +import com.epmet.redis.StaffRoleRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -66,10 +67,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -104,6 +102,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -327,6 +327,18 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(userEntity.getId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(),r.getRoleName()); + }); + dto.setRoles(m.toString()); + staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); } @@ -388,6 +400,18 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(fromDTO.getStaffId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(),r.getRoleName()); + }); + dto.setRoles(m.toString()); + staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); return new Result(); }