Commit f202e2d8 by guojuxing

资源授权通知调整

parent 878bb044
package com.gic.auth.dto;
import java.io.Serializable;
import java.util.List;
/**
* 资源组用户域授权信息
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/25 9:59 AM

*/
public class CustomAreaDTO implements Serializable{
private static final long serialVersionUID = 9035915394117084382L;
/**
* 用户域 0:不授予 1:授予
*/
private Integer customUser;
/**
* 用户域配置json转为类
*/
private List<ResourceGroupCustomUserDTO> customUserList;
/**
* 线下门店订单 1:用户在授权管辖门店范围内的订单 2:用户下所有订单
*/
private Integer storeOrderArea;
/**
* 微盟商城订单 1:用户在授权店铺范围内的订单 2:不授予
*/
private Integer weimobOrderArea;
/**
* 微盟店铺多选,weimob_order_area选择1时选择店铺
*/
private List<Long> weimobStoreId;
/**
* 短信签名
*/
private List<Long> smsId;
public Integer getCustomUser() {
return customUser;
}
public CustomAreaDTO setCustomUser(Integer customUser) {
this.customUser = customUser;
return this;
}
public List<ResourceGroupCustomUserDTO> getCustomUserList() {
return customUserList;
}
public CustomAreaDTO setCustomUserList(List<ResourceGroupCustomUserDTO> customUserList) {
this.customUserList = customUserList;
return this;
}
public Integer getStoreOrderArea() {
return storeOrderArea;
}
public CustomAreaDTO setStoreOrderArea(Integer storeOrderArea) {
this.storeOrderArea = storeOrderArea;
return this;
}
public Integer getWeimobOrderArea() {
return weimobOrderArea;
}
public CustomAreaDTO setWeimobOrderArea(Integer weimobOrderArea) {
this.weimobOrderArea = weimobOrderArea;
return this;
}
public List<Long> getWeimobStoreId() {
return weimobStoreId;
}
public CustomAreaDTO setWeimobStoreId(List<Long> weimobStoreId) {
this.weimobStoreId = weimobStoreId;
return this;
}
public List<Long> getSmsId() {
return smsId;
}
public CustomAreaDTO setSmsId(List<Long> smsId) {
this.smsId = smsId;
return this;
}
@Override
public String toString() {
return "CustomAreaDTO{" +
"customUser=" + customUser +
", customUserList=" + customUserList +
", storeOrderArea=" + storeOrderArea +
", weimobOrderArea=" + weimobOrderArea +
", weimobStoreId=" + weimobStoreId +
", smsId=" + smsId +
'}';
}
}
package com.gic.auth.dto;
import java.io.Serializable;
import java.util.List;
/**
* 联合商户资源授权通知
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/24 4:50 PM

*/
public class UnionEnterpriseAuthResNoticeDTO implements Serializable{
private static final long serialVersionUID = -7222957448764839407L;
/**
* 自有商户ID
*/
private Integer ownEnterpriseId;
/**
* 联合商户ID
*/
private Integer unionEnterpriseId;
/**
* 门店资源
*/
private Long storeResource;
/**
* 商品资源
*/
private Long goodsResourceId;
/**
* 用户域的域数据变更信息
*/
private List<UserResourceChangeInfoDTO> userResourceInfoList;
/**
* 最新的资源组用户域配置信息
*/
private CustomAreaDTO customAreaDTO;
public Long getStoreResource() {
return storeResource;
}
public UnionEnterpriseAuthResNoticeDTO setStoreResource(Long storeResource) {
this.storeResource = storeResource;
return this;
}
public Long getGoodsResourceId() {
return goodsResourceId;
}
public UnionEnterpriseAuthResNoticeDTO setGoodsResourceId(Long goodsResourceId) {
this.goodsResourceId = goodsResourceId;
return this;
}
public List<UserResourceChangeInfoDTO> getUserResourceInfoList() {
return userResourceInfoList;
}
public UnionEnterpriseAuthResNoticeDTO setUserResourceInfoList(List<UserResourceChangeInfoDTO> userResourceInfoList) {
this.userResourceInfoList = userResourceInfoList;
return this;
}
public Integer getOwnEnterpriseId() {
return ownEnterpriseId;
}
public UnionEnterpriseAuthResNoticeDTO setOwnEnterpriseId(Integer ownEnterpriseId) {
this.ownEnterpriseId = ownEnterpriseId;
return this;
}
public Integer getUnionEnterpriseId() {
return unionEnterpriseId;
}
public UnionEnterpriseAuthResNoticeDTO setUnionEnterpriseId(Integer unionEnterpriseId) {
this.unionEnterpriseId = unionEnterpriseId;
return this;
}
public CustomAreaDTO getCustomAreaDTO() {
return customAreaDTO;
}
public UnionEnterpriseAuthResNoticeDTO setCustomAreaDTO(CustomAreaDTO customAreaDTO) {
this.customAreaDTO = customAreaDTO;
return this;
}
@Override
public String toString() {
return "UnionEnterpriseAuthResNoticeDTO{" +
"ownEnterpriseId=" + ownEnterpriseId +
", unionEnterpriseId=" + unionEnterpriseId +
", storeResource=" + storeResource +
", goodsResourceId=" + goodsResourceId +
", userResourceInfoList=" + userResourceInfoList +
", customAreaDTO=" + customAreaDTO +
'}';
}
}
package com.gic.auth.dto;
import java.io.Serializable;
import java.util.List;
/**
* 用户域资源域数据(小程序、服务号、会员卡等)变更情况信息
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/24 4:53 PM

*/
public class UserResourceChangeInfoDTO implements Serializable{
private static final long serialVersionUID = 5480272198512708835L;
/**
* 域数据类型 CuTypeEnum枚举
*/
private Integer type;
/**
* 增加的域ID
*/
private List<Long> addList;
/**
* 删除的域ID集合
*/
private List<Long> deleteList;
public Integer getType() {
return type;
}
public UserResourceChangeInfoDTO setType(Integer type) {
this.type = type;
return this;
}
public List<Long> getAddList() {
return addList;
}
public UserResourceChangeInfoDTO setAddList(List<Long> addList) {
this.addList = addList;
return this;
}
public List<Long> getDeleteList() {
return deleteList;
}
public UserResourceChangeInfoDTO setDeleteList(List<Long> deleteList) {
this.deleteList = deleteList;
return this;
}
@Override
public String toString() {
return "UserResourceChangeInfoDTO{" +
"type=" + type +
", addList=" + addList +
", deleteList=" + deleteList +
'}';
}
}
package com.gic.auth.service.outer.impl;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.auth.constant.ResourceHoldEnum;
import com.gic.auth.dto.*;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.service.*;
import com.gic.auth.utils.resourcegroup.ResourceGroupUtils;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthResNoticeDTO;
import com.gic.enterprise.dto.union.UserResourceChangeInfoDTO;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.enterprise.service.UnionEnterpriseAuthApiService;
import com.gic.mq.sdk.GicMQClient;
import com.gic.store.service.StoreWidgetApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -27,13 +13,24 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.application.center.api.service.AuthorizeService;
import com.gic.auth.dto.*;
import com.gic.auth.entity.TabSysResourceGroup;
import com.gic.auth.service.*;
import com.gic.auth.utils.resourcegroup.ResourceGroupUtils;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.service.UnionEnterpriseAuthApiService;
import com.gic.mq.sdk.GicMQClient;
import com.gic.store.service.StoreWidgetApiService;
/**
* 资源组
......@@ -104,6 +101,10 @@ public class ResourceGroupApiServiceImpl implements ResourceGroupApiService{
unionEnterpriseAuthResNoticeDTO.setStoreResource(newResourceGroup.getStoreResource());
unionEnterpriseAuthResNoticeDTO.setOwnEnterpriseId(ownEnterpriseId);
unionEnterpriseAuthResNoticeDTO.setUnionEnterpriseId(unionEnterpriseId);
CustomUserAreaDTO customUserAreaDTO = ResourceGroupUtils
.getResource(ResourceGroupUtils.CUSTOM_RESOURCE, EntityUtil.changeEntityNew(TabSysResourceGroup.class, newResourceGroup));
unionEnterpriseAuthResNoticeDTO.setCustomAreaDTO(EntityUtil.changeEntityNew(CustomAreaDTO.class, customUserAreaDTO));
List<UserResourceChangeInfoDTO> userResourceInfoList = new ArrayList<>();
......
......@@ -65,6 +65,10 @@ public class ResourceGroupUtils {
return map.get(resourceGroupType).getResourceData(tabSysResourceGroup);
}
public static <T> T getResource(Integer resourceGroupType, TabSysResourceGroup tabSysResourceGroup) {
return map.get(resourceGroupType).getResourceData(tabSysResourceGroup);
}
/**
* 查询全部资源
* @param userId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment