主要逻辑: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. 国外程序员整理的 C++ 资源大全 (zt)

    关于 C++ 框架.库和资源的一些汇总列表,由 fffaraz 发起和维护. 内容包括:标准库.Web应用框架.人工智能.数据库.图片处理.机器学习.日志.代码分析等. 标准库 C++标准库,包括了S ...

  2. aliyun阿里云Maven仓库配置

    maven仓库用过的人都知道,国内有多么的悲催.还好有比较好用的镜像可以使用,尽快记录下来.速度提升100倍. http://maven.aliyun.com/nexus/#view-reposito ...

  3. leetcode — 4sum

    import java.util.Arrays; import java.util.HashSet; import java.util.Set; /** * Source : https://oj.l ...

  4. leetcode — integer-to-roman

    /** * Source : https://oj.leetcode.com/problems/integer-to-roman/ * * Created by lverpeng on 2017/7/ ...

  5. Beego学习笔记

    Beego学习笔记 Go 路由(Controller) 路由就是根据用户的请求找到需要执行的函数或者controller. Get /v1/shop/nike ShopController Get D ...

  6. angularjs学习第五天笔记(第二篇:表单验证升级篇)

    您好,我是一名后端开发工程师,由于工作需要,现在系统的从0开始学习前端js框架之angular,每天把学习的一些心得分享出来,如果有什么说的不对的地方,请多多指正,多多包涵我这个前端菜鸟,欢迎大家的点 ...

  7. c# 过滤html

    public static string StripHTML(string html) { try { System.Text.RegularExpressions.Regex regex1 = ne ...

  8. Strust2框架笔记01_XML配置_action编写

    目录 1.Struts2概述 1.1 什么是Struts2 1.2 Web层框架基于前端控制器模型设计 2. Struts2入门案例 2.1 Struts2的开发环境 2.2 解压开发包 2.3 创建 ...

  9. List排序Collections.sort 重写compare

    static List<Integer> intList = Arrays.asList(2,5,7, 3, 1); public static void main(String[] ar ...

  10. Git实战手册(二): 标签应用和版本管理

    教程所示图片使用的是 github 仓库图片,墙内朋友请移步原文地址 有空就来看看个人技术小站, 我一直都在 0. 背景介绍 当一个代码仓库进过长时间的迭代,针对不同的时期和需求,必定会有不同的版本. ...