Commit 15c759e5 by guojuxing

联合商户视角接口

parent bc528a97
package com.gic.enterprise.dto.union;
import java.io.Serializable;
import java.util.Date;
/**
* 自有商户列表
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/7 3:31 PM

*/
public class OwnEnterpriseAuthListDTO implements Serializable{
private static final long serialVersionUID = -3910274283656104847L;
private String userName;
private String phoneNumber;
/**
* 国际区号,如中国 86
*/
private String phoneAreaCode;
private String enterpriseName;
private String companyName;
private String address;
private String logo;
/**
* 自有商户ID
*/
private Integer enterpriseId;
/**
* 联合商户记录主键
*/
private Integer unionEnterpriseAuthId;
/**
* 1:有效 2:解除中 3: 已解除联合
*/
private Integer statusFlag;
/**
* 最新解除时间(最后一项资源收回完毕时间
*/
private Date lastRelieveTime;
/**
* 最新联合完成时间(最后一项资源授权完毕时间
*/
private Date lastUnionTime;
public String getUserName() {
return userName;
}
public OwnEnterpriseAuthListDTO setUserName(String userName) {
this.userName = userName;
return this;
}
public String getPhoneNumber() {
return phoneNumber;
}
public OwnEnterpriseAuthListDTO setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
public String getPhoneAreaCode() {
return phoneAreaCode;
}
public OwnEnterpriseAuthListDTO setPhoneAreaCode(String phoneAreaCode) {
this.phoneAreaCode = phoneAreaCode;
return this;
}
public String getEnterpriseName() {
return enterpriseName;
}
public OwnEnterpriseAuthListDTO setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
return this;
}
public String getCompanyName() {
return companyName;
}
public OwnEnterpriseAuthListDTO setCompanyName(String companyName) {
this.companyName = companyName;
return this;
}
public String getAddress() {
return address;
}
public OwnEnterpriseAuthListDTO setAddress(String address) {
this.address = address;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public OwnEnterpriseAuthListDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public Integer getUnionEnterpriseAuthId() {
return unionEnterpriseAuthId;
}
public OwnEnterpriseAuthListDTO setUnionEnterpriseAuthId(Integer unionEnterpriseAuthId) {
this.unionEnterpriseAuthId = unionEnterpriseAuthId;
return this;
}
public Integer getStatusFlag() {
return statusFlag;
}
public OwnEnterpriseAuthListDTO setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
return this;
}
public Date getLastRelieveTime() {
return lastRelieveTime;
}
public OwnEnterpriseAuthListDTO setLastRelieveTime(Date lastRelieveTime) {
this.lastRelieveTime = lastRelieveTime;
return this;
}
public Date getLastUnionTime() {
return lastUnionTime;
}
public OwnEnterpriseAuthListDTO setLastUnionTime(Date lastUnionTime) {
this.lastUnionTime = lastUnionTime;
return this;
}
public String getLogo() {
return logo;
}
public OwnEnterpriseAuthListDTO setLogo(String logo) {
this.logo = logo;
return this;
}
@Override
public String toString() {
return "OwnEnterpriseAuthListDTO{" +
"userName='" + userName + '\'' +
", phoneNumber='" + phoneNumber + '\'' +
", phoneAreaCode='" + phoneAreaCode + '\'' +
", enterpriseName='" + enterpriseName + '\'' +
", companyName='" + companyName + '\'' +
", address='" + address + '\'' +
", logo='" + logo + '\'' +
", enterpriseId=" + enterpriseId +
", unionEnterpriseAuthId=" + unionEnterpriseAuthId +
", statusFlag=" + statusFlag +
", lastRelieveTime=" + lastRelieveTime +
", lastUnionTime=" + lastUnionTime +
'}';
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthAppDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthListDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthResDTO;
import com.gic.enterprise.dto.union.*;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
......@@ -92,4 +89,15 @@ public interface UnionEnterpriseAuthApiService {
* @return
*/
ServiceResponse<List<UnionEnterpriseAuthAppDTO>> listUnionEnterpriseAuthApp(@NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId);
/********联合商户视角接口***********/
/**
* 自有商户列表
* @param unionEnterpriseId
* @param startTime
* @param endTime
* @return
*/
ServiceResponse<List<OwnEnterpriseAuthListDTO>> listOwnEnterpriseAuth(@NotNull Integer unionEnterpriseId, String startTime, String endTime);
}
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.dto.union.OwnEnterpriseAuthListDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthListDTO;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuth;
import org.apache.ibatis.annotations.Param;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
......@@ -74,4 +76,15 @@ public interface TabSysUnionEnterpriseAuthMapper {
List<UnionEnterpriseAuthListDTO> listUnionEnterpriseAuth(@Param("ownEnterpriseId") Integer ownEnterpriseId,
@Param("list") List<Integer> unionEnterpriseIdList,
@Param("authStatus") Integer authStatus);
/**
* 自有商户列表
* @param unionEnterpriseId
* @param startTime
* @param endTime
* @return
*/
List<OwnEnterpriseAuthListDTO> listOwnEnterpriseAuth(@Param("unionEnterpriseId") Integer unionEnterpriseId,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.dto.union.OwnEnterpriseAuthListDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthListDTO;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuth;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
......@@ -45,4 +47,13 @@ public interface UnionEnterpriseAuthService {
* @return
*/
List<UnionEnterpriseAuthListDTO> listUnionEnterpriseAuth(Integer ownEnterpriseId, List<Integer> unionEnterpriseIdList, Integer authStatus);
/**
* 查询自有商户列表
* @param unionEnterpriseId
* @param startTime
* @param endTime
* @return
*/
List<OwnEnterpriseAuthListDTO> listOwnEnterpriseAuth(@NotNull Integer unionEnterpriseId, String startTime, String endTime);
}
......@@ -3,6 +3,7 @@ package com.gic.enterprise.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthStatusEnum;
import com.gic.enterprise.dao.mapper.TabSysUnionEnterpriseAuthMapper;
import com.gic.enterprise.dto.union.OwnEnterpriseAuthListDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthListDTO;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuth;
......@@ -10,6 +11,7 @@ import com.gic.enterprise.service.UnionEnterpriseAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
......@@ -54,4 +56,10 @@ public class UnionEnterpriseAuthServiceImpl implements UnionEnterpriseAuthServic
public List<UnionEnterpriseAuthListDTO> listUnionEnterpriseAuth(Integer ownEnterpriseId, List<Integer> unionEnterpriseIdList, Integer authStatus) {
return tabSysUnionEnterpriseAuthMapper.listUnionEnterpriseAuth(ownEnterpriseId, unionEnterpriseIdList, authStatus);
}
@Override
public List<OwnEnterpriseAuthListDTO> listOwnEnterpriseAuth(@NotNull Integer unionEnterpriseId, String startTime, String endTime) {
return tabSysUnionEnterpriseAuthMapper.listOwnEnterpriseAuth(unionEnterpriseId, startTime, endTime);
}
}
......@@ -253,6 +253,37 @@ public class UnionEnterpriseAuthApiServiceImpl implements UnionEnterpriseAuthApi
return ServiceResponse.success(Collections.emptyList());
}
@Override
public ServiceResponse<List<OwnEnterpriseAuthListDTO>> listOwnEnterpriseAuth(@NotNull Integer unionEnterpriseId, String startTime, String endTime) {
List<OwnEnterpriseAuthListDTO> list = unionEnterpriseAuthService.listOwnEnterpriseAuth(unionEnterpriseId, startTime, endTime);
if (CollectionUtils.isNotEmpty(list)) {
//组装数据
//1:自有商户数据
List<Integer> enterpriseIdList = list.stream().mapToInt(e -> e.getEnterpriseId()).boxed().collect(Collectors.toList());
Map<Integer, TabEnterprise> enterpriseMap = getEnterprise(enterpriseIdList);
//2:超管数据
Map<Integer, UserDTO> userMap = getUser(enterpriseIdList);
//填充数据
for (OwnEnterpriseAuthListDTO obj : list) {
TabEnterprise enterprise = enterpriseMap.get(obj.getEnterpriseId());
if (enterprise != null) {
obj.setCompanyName(enterprise.getCompanyName());
obj.setAddress(enterprise.getAddress());
obj.setEnterpriseName(enterprise.getEnterpriseName());
obj.setLogo(enterprise.getLogo());
}
UserDTO user = userMap.get(obj.getEnterpriseId());
if (user != null) {
obj.setUserName(user.getUserName());
obj.setPhoneAreaCode(user.getPhoneAreaCode());
obj.setPhoneNumber(user.getPhoneNumber());
}
}
return ServiceResponse.success(list);
}
return ServiceResponse.success(Collections.emptyList());
}
private Map<Integer, TabEnterprise> getEnterprise(List<Integer> enterpriseIdList) {
List<TabEnterprise> enterpriseList = enterpriseService.listEnterpriseByIds(enterpriseIdList);
if (CollectionUtils.isNotEmpty(enterpriseList)) {
......
......@@ -279,4 +279,25 @@
GROUP BY auth.union_enterprise_id
</select>
<select id="listOwnEnterpriseAuth" resultType="com.gic.enterprise.dto.union.OwnEnterpriseAuthListDTO">
select union_enterprise_auth_id unionEnterpriseAuthId,
own_enterprise_id enterpriseId,
status_flag statusFlag,
last_relieve_time lastRelieveTime,
last_union_time lastUnionTime
from tab_sys_union_enterprise_auth
where delete_flag = 0
<if test="startTime != null">
and (last_union_time >= #{startTime} or last_relieve_time >= #{startTime})
</if>
<if test="endTime != null">
and (last_union_time &lt;= #{endTime} or last_relieve_time &lt;= #{endTime})
</if>
and union_enterprise_id = #{unionEnterpriseId}
</select>
</mapper>
\ No newline at end of file
......@@ -21,7 +21,10 @@ public class OwnEnterpriseAccountGroupVO implements Serializable{
*/
private String accountGroupName;
private Integer userCount;
/**
* 组员数量
*/
private Integer memberCount;
public Integer getAccountGroupId() {
return accountGroupId;
......@@ -41,12 +44,12 @@ public class OwnEnterpriseAccountGroupVO implements Serializable{
return this;
}
public Integer getUserCount() {
return userCount;
public Integer getMemberCount() {
return memberCount;
}
public OwnEnterpriseAccountGroupVO setUserCount(Integer userCount) {
this.userCount = userCount;
public OwnEnterpriseAccountGroupVO setMemberCount(Integer memberCount) {
this.memberCount = memberCount;
return this;
}
......@@ -55,7 +58,7 @@ public class OwnEnterpriseAccountGroupVO implements Serializable{
return "OwnEnterpriseAccountGroupVO{" +
"accountGroupId=" + accountGroupId +
", accountGroupName='" + accountGroupName + '\'' +
", userCount=" + userCount +
", memberCount=" + memberCount +
'}';
}
}
package com.gic.enterprise.web.vo.union;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.List;
/**
* 联合商户视角-应用资源详情
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/7 6:39 PM

*/
public class OwnEnterpriseAuthAppDetailVO implements Serializable{
private static final long serialVersionUID = -8196570924430477499L;
/**
* 主键
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long applicationId;
/**
* 应用名称
*/
private String name;
/**
* 应用图标链接
*/
private String iconUrl;
/**
* 0:不授予 1:授予
*/
private Integer appAuthStatus;
private List<OwnerMemberCardVO> memberArea;
private List<AppletsConfigSimpleOutputVO> appletArea;
private List<ServiceConfigSimpleOutputVO> serviceArea;
public Long getApplicationId() {
return applicationId;
}
public OwnEnterpriseAuthAppDetailVO setApplicationId(Long applicationId) {
this.applicationId = applicationId;
return this;
}
public String getName() {
return name;
}
public OwnEnterpriseAuthAppDetailVO setName(String name) {
this.name = name;
return this;
}
public String getIconUrl() {
return iconUrl;
}
public OwnEnterpriseAuthAppDetailVO setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
return this;
}
public Integer getAppAuthStatus() {
return appAuthStatus;
}
public OwnEnterpriseAuthAppDetailVO setAppAuthStatus(Integer appAuthStatus) {
this.appAuthStatus = appAuthStatus;
return this;
}
public List<OwnerMemberCardVO> getMemberArea() {
return memberArea;
}
public OwnEnterpriseAuthAppDetailVO setMemberArea(List<OwnerMemberCardVO> memberArea) {
this.memberArea = memberArea;
return this;
}
public List<AppletsConfigSimpleOutputVO> getAppletArea() {
return appletArea;
}
public OwnEnterpriseAuthAppDetailVO setAppletArea(List<AppletsConfigSimpleOutputVO> appletArea) {
this.appletArea = appletArea;
return this;
}
public List<ServiceConfigSimpleOutputVO> getServiceArea() {
return serviceArea;
}
public OwnEnterpriseAuthAppDetailVO setServiceArea(List<ServiceConfigSimpleOutputVO> serviceArea) {
this.serviceArea = serviceArea;
return this;
}
@Override
public String toString() {
return "OwnEnterpriseAuthAppDetailVO{" +
"applicationId=" + applicationId +
", name='" + name + '\'' +
", iconUrl='" + iconUrl + '\'' +
", appAuthStatus=" + appAuthStatus +
", memberArea=" + memberArea +
", appletArea=" + appletArea +
", serviceArea=" + serviceArea +
'}';
}
}
......@@ -30,6 +30,8 @@ public class OwnEnterpriseListVO implements Serializable{
private String enterpriseId;
private String logo;
/**
* 1:有效 2:解除中 3: 已解除联合
*/
......@@ -55,6 +57,11 @@ public class OwnEnterpriseListVO implements Serializable{
*/
private Date lastUnionTime;
/**
* 联合商户记录主键
*/
private Integer unionEnterpriseAuthId;
public String getUserName() {
return userName;
}
......@@ -163,6 +170,24 @@ public class OwnEnterpriseListVO implements Serializable{
return this;
}
public Integer getUnionEnterpriseAuthId() {
return unionEnterpriseAuthId;
}
public OwnEnterpriseListVO setUnionEnterpriseAuthId(Integer unionEnterpriseAuthId) {
this.unionEnterpriseAuthId = unionEnterpriseAuthId;
return this;
}
public String getLogo() {
return logo;
}
public OwnEnterpriseListVO setLogo(String logo) {
this.logo = logo;
return this;
}
@Override
public String toString() {
return "OwnEnterpriseListVO{" +
......@@ -173,11 +198,13 @@ public class OwnEnterpriseListVO implements Serializable{
", companyName='" + companyName + '\'' +
", address='" + address + '\'' +
", enterpriseId='" + enterpriseId + '\'' +
", logo='" + logo + '\'' +
", statusFlag=" + statusFlag +
", relieveTime=" + relieveTime +
", lastRelieveTime=" + lastRelieveTime +
", relieveEffectDate=" + relieveEffectDate +
", lastUniontime=" + lastUnionTime +
", lastUnionTime=" + lastUnionTime +
", unionEnterpriseAuthId=" + unionEnterpriseAuthId +
'}';
}
}
......@@ -67,6 +67,21 @@ public class OwnEnterpriseResourceDetailVO implements Serializable{
private List<OwnEnterpriseAccountGroupVO> accountGroup;
/**
* 数据加密字段 1:用户手机号、卡号 2:用户收获地址 。多选,英文逗号隔开
*/
private String dataEncryField;
/**
* 用户修改权限 1:用户归属修改权限 2:用户等级修改权限 3:用户积分修改权限 4:用户手机号修改权限 。多选,英文逗号隔开
*/
private String userEditAuth;
/**
* 白名单用户授权 1:是 0:否
*/
private Integer whiteListAuth;
public Integer getResourceGroupId() {
return resourceGroupId;
}
......@@ -175,6 +190,33 @@ public class OwnEnterpriseResourceDetailVO implements Serializable{
return this;
}
public String getDataEncryField() {
return dataEncryField;
}
public OwnEnterpriseResourceDetailVO setDataEncryField(String dataEncryField) {
this.dataEncryField = dataEncryField;
return this;
}
public String getUserEditAuth() {
return userEditAuth;
}
public OwnEnterpriseResourceDetailVO setUserEditAuth(String userEditAuth) {
this.userEditAuth = userEditAuth;
return this;
}
public Integer getWhiteListAuth() {
return whiteListAuth;
}
public OwnEnterpriseResourceDetailVO setWhiteListAuth(Integer whiteListAuth) {
this.whiteListAuth = whiteListAuth;
return this;
}
@Override
public String toString() {
return "OwnEnterpriseResourceDetailVO{" +
......@@ -190,6 +232,9 @@ public class OwnEnterpriseResourceDetailVO implements Serializable{
", smsId='" + smsId + '\'' +
", auditedGroup=" + auditedGroup +
", accountGroup=" + accountGroup +
", dataEncryField='" + dataEncryField + '\'' +
", userEditAuth='" + userEditAuth + '\'' +
", whiteListAuth=" + whiteListAuth +
'}';
}
}
......@@ -22,6 +22,11 @@ public class UnionAppResourceListVO implements Serializable{
private Integer unionEnterpriseAuthAppId;
/**
* 0:不授予 1:授予
*/
private Integer appAuthStatus;
private List<OwnerMemberCardVO> memberArea;
private List<AppletsConfigSimpleOutputVO> appletArea;
......@@ -93,12 +98,22 @@ public class UnionAppResourceListVO implements Serializable{
return this;
}
public Integer getAppAuthStatus() {
return appAuthStatus;
}
public UnionAppResourceListVO setAppAuthStatus(Integer appAuthStatus) {
this.appAuthStatus = appAuthStatus;
return this;
}
@Override
public String toString() {
return "UnionAppResourceListVO{" +
"strategyName='" + strategyName + '\'' +
", authData='" + authData + '\'' +
", unionEnterpriseAuthAppId=" + unionEnterpriseAuthAppId +
", appAuthStatus=" + appAuthStatus +
", memberArea=" + memberArea +
", appletArea=" + appletArea +
", serviceArea=" + serviceArea +
......
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