主要逻辑:xxx.service.impl.ConsultantServiceImpl

 public class ConsultantServiceImpl extends DefaultCustomerAccountService implements ConsultantService, CustomerAccountService
{
@Resource
private ConsultantDao consultantDao; @Resource
private ModelService modelService; public SearchPageData<CustomerModel> findAllCustomersByGroups(final List<String> groupKeys, final PageableData pageableData){
return consultantDao.findAllCustomersByGroups(groupKeys,pageableData);
} public UserModel getCurrentUser(){
return getUserService().getCurrentUser();
} public UserGroupModel getGroupForUid(String uid){
return getUserService().getUserGroupForUID(uid);
} public void saveCustomer(CustomerModel customerModel){
modelService.save(customerModel);
} public void initGroupForConsulatnt(CustomerModel customerModel){ if (customerModel.getCustomerRole()!=null&&customerModel.getCustomerRole().getCode().equals("customer")){
UserGroupModel userGroupModel = getGroupForUid(Config.getString(VehiclecommerceservicesConstants.CUSTOMER_GROUP_FOR_BUYER,"buyergroup"));
Set<PrincipalGroupModel> userGroups = new HashSet<>(customerModel.getGroups());
userGroups.add(userGroupModel);
customerModel.setGroups(userGroups);
}else{
UserGroupModel userGroupModel = getGroupForUid(Config.getString(VehiclecommerceservicesConstants.CUSTOMER_GROUP_FOR_CONSULATNT,"salesconsultant"));
Set<PrincipalGroupModel> userGroups = new HashSet<>(customerModel.getGroups());
userGroups.add(userGroupModel);
customerModel.setGroups(userGroups);
} }
}

Hybris 用户注册的时候何如添加指定的用户组的更多相关文章

  1. Oracle 当前日期如何添加指定年数、月数、天数、时数、分钟数、秒数

    Oracle 当前时间如何添加指定数,来获取指定的年数.月份或其他的时间日期 --当前时间(2018-10-19 16:51:22)--- select sysdate nowDate from du ...

  2. linux系统添加指定uid和gid的用户和组

    1.添加指定gid的组 groupadd -g 1001 upload # 添加了一个指定gid为1001的upload用户 2.添加指定uid的用户,并加入到指定组 useradd -u 1001 ...

  3. excel 如何为列添加指定内容(字符串)

      excel 如何为列添加指定内容(字符串) CreateTime--2018年5月26日17:52:32 Author:Marydon 1.情景展示 D列的值需要获取B列的值并且在后面统一加上12 ...

  4. Eclipse中导入JDK类库的源代码以及添加指定的API

    一.在Eclipse中导入JDK类库的源代码 操作步骤: 打开eclipse->“window”-> “Preferences” -> “Java” -> “Installed ...

  5. python练习六十二:文件处理,往文件中所有添加指定的前缀

    往文件中所有添加指定的前缀 方法一:open方法 f_r = open('text.txt') f_w = open('text_new.txt','w+') i = 0 while True: i ...

  6. Confluence 6 自动添加用户到用户组

    默认组成员(Default Group Memberships) 选项在 Confluence 3.5 及后续版本和 JIRA 4.3.3 及后续版本中可用.这字段将会在你选择 'Read Only, ...

  7. Linux下添加用户及用户组

    创建用户组hdpgroup: $ sudo addgroup hdpgroup 如果用户hdp不存在,把hdp添加到hdpgroup用户组: $ sudo adduser --force -ingro ...

  8. git只添加指定类型的文件的.gitignore规则

    #忽略根目录下的所有文件 * #忽略子目录下的所有文件 /* #包含目录 !*/ #指定不忽略的文件 !*.c !*.h #忽略根目录下的文件 /build/ /appveyor/ /pear/ /s ...

  9. matlab 工具函数(一) —— 添加指定 SNR 的噪声

    SNR=PsignalPnoise=10⋅log10∑x=1Nx∑y=1Nyf2(x,y)∑x=1Nx∑y=1Ny(f(x,y)−f^(x,y))2=20⋅log10∥f(x,y)∥∥f^(x,y)− ...

随机推荐

  1. s3 api接口的调用

    最近公司使用s3做文件存储服务器,因此在程序中需要调用s3的api,目前程序中使用了python和java版本的s3的api,简单做下记录,方便以后使用. 一.s3 api使用python版 1.安装 ...

  2. RC1015 cannot open include file 'atlres.h'

    fatal error RC1015: cannot open include file 'atlres.h' 问题:此问题是由于rc文件没有找到 atlres.h导致的 (原因不详) 解决:工程   ...

  3. Spring Data JPA例子[基于Spring Boot、Mysql]

    关于Spring Data Spring社区的一个顶级工程,主要用于简化数据(关系型&非关系型)访问,如果我们使用Spring Data来开发程序的话,那么可以省去很多低级别的数据访问操作,如 ...

  4. Mysql 用户权限管理

    1. MySQL 权限介绍 mysql中存在4个控制权限的表,分别为user表,db表,tables_priv表,columns_priv表,我当前的版本mysql 5.7.22 . mysql权限表 ...

  5. C#效率优化(1)-- 使用泛型时避免装箱

    本想接着上一篇详解泛型接着写一篇使用泛型时需要注意的一个性能问题,但是后来想着不如将之前的详解XX系列更正为现在的效率优化XX系列,记录在工作时遇到的一些性能优化的经验和技巧,如果有什么不足,还请大家 ...

  6. SQL 必知必会·笔记<3>过滤数据

    在同时使用ORDER BY 和WHERE 子句时,应该让ORDER BY 位于 WHERE 之后,否则将会产生错误 WHERE子句操作符 范围值检查 使用BETWEEN 操作符,示例: SELECT ...

  7. JVM笔记11-类加载器和OSGI

    一.JVM 类加载器: 一个类在使用前,如何通过类调用静态字段,静态方法,或者new一个实例对象,第一步就是需要类加载,然后是连接和初始化,最后才能使用. 类从被加载到虚拟机内存中开始,到卸载出内存为 ...

  8. kubeadm部署kubernetes-1.12.0 HA集群-ipvs

    一.概述 主要介绍搭建流程及使用注意事项,如果线上使用的话,请务必做好相关测试及压测. 1.基础环境准备 系统:ubuntu TLS 16.04  5台 docker-ce:17.06.2 kubea ...

  9. OpenCV两种畸变校正模型源代码分析以及CUDA实现

    图像算法中会经常用到摄像机的畸变校正,有必要总结分析OpenCV中畸变校正方法,其中包括普通针孔相机模型和鱼眼相机模型fisheye两种畸变校正方法. 普通相机模型畸变校正函数针对OpenCV中的cv ...

  10. cannot import name 'Flask' from 'flask'

    今天发现了智障的真我. 刚入门flask,建了一个文件命名叫flask.py 在virtualenv的容器里运行该py文件,报错cannot import name 'Flask' from 'fla ...