|
|
@ -39,6 +39,8 @@ import com.epmet.feign.GovAccessFeignClient; |
|
|
|
import com.epmet.redis.GovStaffRoleRedis; |
|
|
|
import com.epmet.service.GovStaffRoleService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -57,6 +59,8 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, GovStaffRoleEntity> implements GovStaffRoleService { |
|
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private GovStaffRoleRedis govStaffRoleRedis; |
|
|
|
|
|
|
@ -140,8 +144,13 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void initGovStaffRolesForCustomer(String customerId) { |
|
|
|
Integer rolesCount = baseDao.countRolesByCustomerId(customerId); |
|
|
|
if (rolesCount > 0) { |
|
|
|
logger.info("为客户初始化角色列表-该客户【客户ID:%s】已存在角色信息,无需再次初始化。", customerId); |
|
|
|
return; |
|
|
|
} |
|
|
|
// 增加角色列表
|
|
|
|
List<GovStaffRoleTemplateDTO> validRoles = govStaffRoleTemplateDao.listValidateRoles(); |
|
|
|
|
|
|
|