Commit 22423a81 by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents 999eca5e fb6abff7
package com.gic.enterprise.constant.union;
/**
* 联合商户授权资源操作类型
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/3 2:03 PM

*/
public enum UnionEnterpriseAuthResOperateEnum {
/**
* 发起联合
*/
UNION(1, "发起联合"),
/**
* 重新授权
*/
RE_AUTH(2, "重新授权"),
/**
* 解除联合
*/
RELIEVED(3, "解除联合"),
/**
* 编辑资源范围
*/
EDIT_RESOURCE_AREA(4, "编辑资源范围"),
/**
* 发起解除联合
*/
START_RELIEVE(5, "发起解除联合");
private Integer code;
private String message;
UnionEnterpriseAuthResOperateEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public UnionEnterpriseAuthResOperateEnum setCode(Integer code) {
this.code = code;
return this;
}
public String getMessage() {
return message;
}
public UnionEnterpriseAuthResOperateEnum setMessage(String message) {
this.message = message;
return this;
}
}
......@@ -28,6 +28,15 @@ public enum UnionEnterpriseAuthResTypeEnum {
this.message = message;
}
public static String getMessage(Integer code) {
for (UnionEnterpriseAuthResTypeEnum type : values()) {
if (type.getCode().equals(code)) {
return type.getMessage();
}
}
return "--";
}
public Integer getCode() {
return code;
}
......
......@@ -18,7 +18,8 @@ public enum UnionEnterpriseAuthStatusEnum {
/**
* 已解除
*/
RELIEVED(3, "已解除");
RELIEVED(3, "已解除"),
TO_DO_RELIEVE(4, "待解除");
private Integer code;
private String message;
......
package com.gic.enterprise.dto.union;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 自有商户列表
* @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;
/**
* 具体资源授权信息
*/
private List<UnionEnterpriseAuthResDetailDTO> unionEnterpriseResourceList;
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;
}
public List<UnionEnterpriseAuthResDetailDTO> getUnionEnterpriseResourceList() {
return unionEnterpriseResourceList;
}
public OwnEnterpriseAuthListDTO setUnionEnterpriseResourceList(List<UnionEnterpriseAuthResDetailDTO> unionEnterpriseResourceList) {
this.unionEnterpriseResourceList = unionEnterpriseResourceList;
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 +
", unionEnterpriseResourceList=" + unionEnterpriseResourceList +
'}';
}
}
package com.gic.enterprise.dto.union;
import java.io.Serializable;
import java.util.Date;
/**
* 资源操作日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/7 7:20 PM

*/
public class UnionEnterpriseAuthResLogDTO implements Serializable{
private static final long serialVersionUID = -2863505864141167299L;
/**
* id
*/
private Integer unionEnterpriseAuthResLogId;
/**
* 联合商户授权主键ID,关联字段
*/
private Integer unionEnterpriseAuthId;
/**
* 1:用户域资源 2:门店资源 3:商品资源
*/
private Integer resourceType;
/**
* 日志内容
*/
private String logContent;
/**
* 处理开始时间
*/
private Date dealStartTime;
/**
* 处理完成时间
*/
private Date dealEndTime;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 状态(0:正常;1:删除)
*/
private Integer deleteFlag;
public Integer getUnionEnterpriseAuthResLogId() {
return unionEnterpriseAuthResLogId;
}
public UnionEnterpriseAuthResLogDTO setUnionEnterpriseAuthResLogId(Integer unionEnterpriseAuthResLogId) {
this.unionEnterpriseAuthResLogId = unionEnterpriseAuthResLogId;
return this;
}
public Integer getUnionEnterpriseAuthId() {
return unionEnterpriseAuthId;
}
public UnionEnterpriseAuthResLogDTO setUnionEnterpriseAuthId(Integer unionEnterpriseAuthId) {
this.unionEnterpriseAuthId = unionEnterpriseAuthId;
return this;
}
public Integer getResourceType() {
return resourceType;
}
public UnionEnterpriseAuthResLogDTO setResourceType(Integer resourceType) {
this.resourceType = resourceType;
return this;
}
public String getLogContent() {
return logContent;
}
public UnionEnterpriseAuthResLogDTO setLogContent(String logContent) {
this.logContent = logContent;
return this;
}
public Date getDealStartTime() {
return dealStartTime;
}
public UnionEnterpriseAuthResLogDTO setDealStartTime(Date dealStartTime) {
this.dealStartTime = dealStartTime;
return this;
}
public Date getDealEndTime() {
return dealEndTime;
}
public UnionEnterpriseAuthResLogDTO setDealEndTime(Date dealEndTime) {
this.dealEndTime = dealEndTime;
return this;
}
public Date getCreateTime() {
return createTime;
}
public UnionEnterpriseAuthResLogDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public UnionEnterpriseAuthResLogDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public UnionEnterpriseAuthResLogDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
@Override
public String toString() {
return "UnionEnterpriseAuthResLogDTO{" +
"unionEnterpriseAuthResLogId=" + unionEnterpriseAuthResLogId +
", unionEnterpriseAuthId=" + unionEnterpriseAuthId +
", resourceType=" + resourceType +
", logContent='" + logContent + '\'' +
", dealStartTime=" + dealStartTime +
", dealEndTime=" + dealEndTime +
", createTime=" + createTime +
", updateTime=" + updateTime +
", deleteFlag=" + deleteFlag +
'}';
}
}
\ No newline at end of file
package com.gic.enterprise.qo.union;
import java.io.Serializable;
/**
* 资源操作日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/8 10:40 AM

*/
public class UnionEnterpriseAuthResLogQO implements Serializable{
private static final long serialVersionUID = 6287422364343763319L;
/**
* 内容
*/
private String content;
private Integer unionEnterpriseAuthId;
private String startTime;
private String endTime;
private Integer pageNum;
private Integer pageSize;
public String getContent() {
return content;
}
public UnionEnterpriseAuthResLogQO setContent(String content) {
this.content = content;
return this;
}
public Integer getUnionEnterpriseAuthId() {
return unionEnterpriseAuthId;
}
public UnionEnterpriseAuthResLogQO setUnionEnterpriseAuthId(Integer unionEnterpriseAuthId) {
this.unionEnterpriseAuthId = unionEnterpriseAuthId;
return this;
}
public String getStartTime() {
return startTime;
}
public UnionEnterpriseAuthResLogQO setStartTime(String startTime) {
this.startTime = startTime;
return this;
}
public String getEndTime() {
return endTime;
}
public UnionEnterpriseAuthResLogQO setEndTime(String endTime) {
this.endTime = endTime;
return this;
}
public Integer getPageNum() {
if (pageNum == null) {
return 1;
}
return pageNum;
}
public UnionEnterpriseAuthResLogQO setPageNum(Integer pageNum) {
this.pageNum = pageNum;
return this;
}
public Integer getPageSize() {
if (pageSize == null) {
return 20;
}
return pageSize;
}
public UnionEnterpriseAuthResLogQO setPageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
@Override
public String toString() {
return "UnionEnterpriseAuthResLogQO{" +
"content='" + content + '\'' +
", unionEnterpriseAuthId=" + unionEnterpriseAuthId +
", startTime='" + startTime + '\'' +
", endTime='" + endTime + '\'' +
", pageNum=" + pageNum +
", pageSize=" + pageSize +
'}';
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
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 com.gic.enterprise.qo.union.UnionEnterpriseAuthResLogQO;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
......@@ -69,6 +68,14 @@ public interface UnionEnterpriseAuthApiService {
*/
ServiceResponse<List<UnionEnterpriseAuthListDTO>> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId, String enterpriseName, Integer authStatus);
/**
* 查询联合商户数据
* @param ownEnterpriseId
* @return
*/
ServiceResponse<List<UnionEnterpriseAuthDTO>> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId);
/**************应用策略************************/
/**
......@@ -92,4 +99,42 @@ public interface UnionEnterpriseAuthApiService {
* @return
*/
ServiceResponse<List<UnionEnterpriseAuthAppDTO>> listUnionEnterpriseAuthApp(@NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId);
/**
* 删除应用策略
* @param unionEnterpriseAuthAppId
* @return
*/
ServiceResponse<String> deleteUnionEnterpriseAuthApp(@NotNull Integer unionEnterpriseAuthAppId);
/**
* 批量删除接口
* @param unionEnterpriseAuthId
* @return
*/
ServiceResponse<String> deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId);
/**
* 到期发送解除联合通知
* @param param
* @return
*/
ServiceResponse<Void> relieveTask(String param);
/********联合商户视角接口***********/
/**
* 自有商户列表
* @param unionEnterpriseId
* @param startTime
* @param endTime
* @return
*/
ServiceResponse<List<OwnEnterpriseAuthListDTO>> listOwnEnterpriseAuth(@NotNull Integer unionEnterpriseId, String startTime, String endTime);
/**
* 操作日志
* @param param
* @return
*/
ServiceResponse<Page<UnionEnterpriseAuthResLogDTO>> listUnionEnterpriseAuthResLog(UnionEnterpriseAuthResLogQO param);
}
......@@ -2,6 +2,8 @@ package com.gic.enterprise.service;
import com.gic.api.base.commons.ServiceResponse;
import javax.validation.constraints.NotNull;
/**
* 联合商户资源详情
* @ClassName:
......@@ -17,4 +19,25 @@ public interface UnionEnterpriseAuthResDetailApiService {
*/
ServiceResponse<Void> authDataCallback();
/**
* 门店资源联合进程
* @param authStatus 资源联合状态 UnionEnterpriseAuthDetailStatusEnum
* @param ownEnterpriseId 自有商户ID
* @param unionEnterpriseId 联合商户ID
* @param authKey 用于重新授权节点
* @param remark 授权备注
* @return
*/
ServiceResponse<Void> unionForStore(@NotNull Integer authStatus, @NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId,
String authKey, String remark);
/**
* 门店资源解除联合进程
* @param authStatus UnionEnterpriseAuthDetailStatusEnum 会有资源处理中,解除成功等状态
* @param ownEnterpriseId
* @param unionEnterpriseId
* @return
*/
ServiceResponse<Void> relieveForStore(@NotNull Integer authStatus, @NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId);
}
package com.gic.enterprise.config;
import javax.validation.ConstraintViolationException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.context.annotation.Configuration;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
/**
* api层错误全部统一返回
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/9 9:46 AM

*/
@Aspect
@Configuration
public class ExceptionResultAop {
private Logger logger = LogManager.getLogger(ExceptionResultAop.class);
/**
* 环绕通知
*
* @param joinPoint
* @return
* @throws Throwable
*/
@Around(value = "execution(* com.gic.*.service.outer.impl..*.*(..))")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
try {
// 执行当前方法
return joinPoint.proceed();
} catch (Throwable throwable) {
logger.warn("拦截器错误", throwable);
return handlerException(throwable);
}
}
private ServiceResponse handlerException(Throwable e) {
ServiceResponse response = new ServiceResponse();
if (e instanceof CommonException) {
response.setCode(((CommonException) e).getErrorCode());
} else if (e instanceof ConstraintViolationException) {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
} else {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
}
response.setMessage(e.getMessage());
return response;
}
}
\ No newline at end of file
package com.gic.enterprise.config;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -12,11 +9,9 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.context.annotation.Configuration;
import javax.validation.ConstraintViolationException;
/**
* 采集GIC系统操作日志
*
*
* @author leeon
* @date 2019年6月28日
*/
......@@ -45,22 +40,8 @@ public class ParamAop {
return joinPoint.proceed();
} catch (Throwable throwable) {
logger.warn("拦截器错误", throwable);
return handlerException(throwable);
}
}
private ServiceResponse handlerException(Throwable e) {
ServiceResponse response = new ServiceResponse();
if (e instanceof CommonException) {
response.setCode(((CommonException) e).getErrorCode());
} else if (e instanceof ConstraintViolationException) {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
} else {
response.setCode(ErrorCode.SYSTEM_ERROR.getCode());
throw throwable;
}
response.setMessage(e.getMessage());
return response;
}
/**
......
......@@ -3,6 +3,7 @@ package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuthApp;
import org.apache.ibatis.annotations.Param;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
......@@ -71,4 +72,11 @@ public interface TabSysUnionEnterpriseAuthAppMapper {
int countRepeatStrategyName(@Param("unionEnterpriseAuthAppId") Integer unionEnterpriseAuthAppId,
@Param("unionEnterpriseAuthId") Integer unionEnterpriseAuthId,
@Param("strategyName") String strategyName);
/**
* 批量删除
* @param unionEnterpriseAuthId
* @return
*/
Integer deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@Param("unionEnterpriseAuthId") Integer unionEnterpriseAuthId);
}
\ No newline at end of file
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,28 @@ 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);
/**
* 查询全部
* @return
*/
List<TabSysUnionEnterpriseAuth> listAll();
/**
* 查询
* @param ownEnterpriseId
* @return
*/
List<TabSysUnionEnterpriseAuth> listUnionEnterprise(@Param("ownEnterpriseId") Integer ownEnterpriseId);
}
\ No newline at end of file
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog;
import com.gic.enterprise.qo.union.UnionEnterpriseAuthResLogQO;
import java.util.List;
/**
* 资源操作日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/8 9:33 AM

*/
public interface TabSysUnionEnterpriseAuthResLogMapper {
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysUnionEnterpriseAuthResLog record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysUnionEnterpriseAuthResLog record);
/**
* 根据主键查询
*
* @param unionEnterpriseAuthResLogId 主键
* @return 实体对象
*/
TabSysUnionEnterpriseAuthResLog selectByPrimaryKey(Integer unionEnterpriseAuthResLogId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysUnionEnterpriseAuthResLog record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysUnionEnterpriseAuthResLog record);
/**
* 日志列表
* @param param
* @return
*/
List<TabSysUnionEnterpriseAuthResLog> listUnionEnterpriseAuthResLog(UnionEnterpriseAuthResLogQO param);
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* 资源操作日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/7 7:20 PM

*/
public class TabSysUnionEnterpriseAuthResLog {
/**
* id
*/
private Integer unionEnterpriseAuthResLogId;
/**
* 联合商户授权主键ID,关联字段
*/
private Integer unionEnterpriseAuthId;
/**
* 1:用户域资源 2:门店资源 3:商品资源
*/
private Integer resourceType;
/**
* 日志内容
*/
private String logContent;
/**
* 处理开始时间
*/
private Date dealStartTime;
/**
* 处理完成时间
*/
private Date dealEndTime;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 状态(0:正常;1:删除)
*/
private Integer deleteFlag;
public Integer getUnionEnterpriseAuthResLogId() {
return unionEnterpriseAuthResLogId;
}
public TabSysUnionEnterpriseAuthResLog setUnionEnterpriseAuthResLogId(Integer unionEnterpriseAuthResLogId) {
this.unionEnterpriseAuthResLogId = unionEnterpriseAuthResLogId;
return this;
}
public Integer getUnionEnterpriseAuthId() {
return unionEnterpriseAuthId;
}
public TabSysUnionEnterpriseAuthResLog setUnionEnterpriseAuthId(Integer unionEnterpriseAuthId) {
this.unionEnterpriseAuthId = unionEnterpriseAuthId;
return this;
}
public Integer getResourceType() {
return resourceType;
}
public TabSysUnionEnterpriseAuthResLog setResourceType(Integer resourceType) {
this.resourceType = resourceType;
return this;
}
public String getLogContent() {
return logContent;
}
public TabSysUnionEnterpriseAuthResLog setLogContent(String logContent) {
this.logContent = logContent;
return this;
}
public Date getDealStartTime() {
return dealStartTime;
}
public TabSysUnionEnterpriseAuthResLog setDealStartTime(Date dealStartTime) {
this.dealStartTime = dealStartTime;
return this;
}
public Date getDealEndTime() {
return dealEndTime;
}
public TabSysUnionEnterpriseAuthResLog setDealEndTime(Date dealEndTime) {
this.dealEndTime = dealEndTime;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabSysUnionEnterpriseAuthResLog setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabSysUnionEnterpriseAuthResLog setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabSysUnionEnterpriseAuthResLog setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
}
\ No newline at end of file
......@@ -51,4 +51,18 @@ public interface UnionEnterpriseAuthAppService {
* @return
*/
TabSysUnionEnterpriseAuthApp getUnionEnterpriseAuthApp(@NotNull Integer unionEnterpriseAuthAppId);
/**
* 删除策略
* @param unionEnterpriseAuthAppId
* @return
*/
int deleteUnionEnterpriseAuthApp(@NotNull Integer unionEnterpriseAuthAppId);
/**
* 批量删除策略
* @param unionEnterpriseAuthId
* @return
*/
Integer deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId);
}
......@@ -32,15 +32,32 @@ public interface UnionEnterpriseAuthResDetailService {
/**
* 资源授权的时候,初始化资源详情数据
* 每一种资源生成一条未授权记录
* 每一种资源生成一条未授权记录.
* 如果已存在,则是编辑逻辑
* @param unionEnterpriseAuthId
*/
void initUnionEnterpriseAuthResDetail(@NotNull Integer unionEnterpriseAuthId);
/**
* 发起解除联合(并未真正开始解除,因为有保留时间)
* @param unionEnterpriseAuthId
*/
void relieveUnion(@NotNull Integer unionEnterpriseAuthId);
/**
* 查询资源详情列表数据
* @param unionEnterpriseAuthIdList
* @return
*/
List<TabSysUnionEnterpriseAuthResDetail> listByUnionEnterpriseAuthIdList(List<Integer> unionEnterpriseAuthIdList);
/**
* 联合资源回调资源状态
* @param unionEnterpriseAuthResDetailId
* @param authStatus UnionEnterpriseAuthDetailStatusEnum
* @param authKey
* @param remark
* @return
*/
int union(@NotNull Integer unionEnterpriseAuthResDetailId, @NotNull Integer authStatus, String authKey, String remark);
}
package com.gic.enterprise.service;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog;
import com.gic.enterprise.qo.union.UnionEnterpriseAuthResLogQO;
import com.github.pagehelper.Page;
import java.util.Date;
/**
* 资源授权操作日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/7 7:27 PM

*/
public interface UnionEnterpriseAuthResLogService {
/**
* 新增操作日志
* @param unionEnterpriseAuthId
* @param resourceType UnionEnterpriseAuthResTypeEnum
* @param logContent 日志内容 UnionEnterpriseAuthResOperateEnum
* @return
*/
int saveUnionEnterpriseAuthResLog(Integer unionEnterpriseAuthId, Integer resourceType, String logContent);
/**
* 新增操作日志
* @param unionEnterpriseAuthId
* @param resourceType
* @param logContent UnionEnterpriseAuthResOperateEnum
* @param dealStartTime 处理开始时间
* @param dealEndTime 处理结束时间
* @return
*/
int saveUnionEnterpriseAuthResLog(Integer unionEnterpriseAuthId, Integer resourceType, String logContent, Date dealStartTime, Date dealEndTime);
/**
* 操作日志查询
* @param param
* @return
*/
Page<TabSysUnionEnterpriseAuthResLog> listUnionEnterpriseAuthResLog(UnionEnterpriseAuthResLogQO param);
}
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,26 @@ 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);
/**
* 查询全部
* @return
*/
List<TabSysUnionEnterpriseAuth> listAll();
/**
* 查询
* @param ownEnterpriseId
* @return
*/
List<TabSysUnionEnterpriseAuth> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId);
}
......@@ -49,7 +49,7 @@ public class UnionEnterpriseAuthAppServiceImpl implements UnionEnterpriseAuthApp
@Override
public boolean isRepeatStrategyName(Integer unionEnterpriseAuthAppId, Integer unionEnterpriseAuthId, String strategyName) {
int count = tabSysUnionEnterpriseAuthAppMapper.countRepeatStrategyName(unionEnterpriseAuthAppId, unionEnterpriseAuthId, strategyName);
if (count > 9) {
if (count > 0) {
return true;
}
return false;
......@@ -59,4 +59,17 @@ public class UnionEnterpriseAuthAppServiceImpl implements UnionEnterpriseAuthApp
public TabSysUnionEnterpriseAuthApp getUnionEnterpriseAuthApp(@NotNull Integer unionEnterpriseAuthAppId) {
return tabSysUnionEnterpriseAuthAppMapper.selectByPrimaryKey(unionEnterpriseAuthAppId);
}
@Override
public int deleteUnionEnterpriseAuthApp(@NotNull Integer unionEnterpriseAuthAppId) {
return tabSysUnionEnterpriseAuthAppMapper.updateByPrimaryKeySelective(new TabSysUnionEnterpriseAuthApp()
.setUpdateTime(new Date())
.setDeleteFlag(1)
.setUnionEnterpriseAuthAppId(unionEnterpriseAuthAppId));
}
@Override
public Integer deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(@NotNull Integer unionEnterpriseAuthId) {
return tabSysUnionEnterpriseAuthAppMapper.deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId(unionEnterpriseAuthId);
}
}
package com.gic.enterprise.service.impl;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthDetailStatusEnum;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResOperateEnum;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResTypeEnum;
import com.gic.enterprise.dao.mapper.TabSysUnionEnterpriseAuthResDetailMapper;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResDetail;
import com.gic.enterprise.service.UnionEnterpriseAuthResDetailService;
import com.gic.enterprise.service.UnionEnterpriseAuthResLogService;
import com.gic.enterprise.service.UnionEnterpriseAuthService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -19,6 +22,10 @@ import java.util.Optional;
public class UnionEnterpriseAuthResDetailServiceImpl implements UnionEnterpriseAuthResDetailService{
@Autowired
private TabSysUnionEnterpriseAuthResDetailMapper tabSysUnionEnterpriseAuthResDetailMapper;
@Autowired
private UnionEnterpriseAuthResLogService unionEnterpriseAuthResLogService;
@Autowired
private UnionEnterpriseAuthService unionEnterpriseAuthService;
@Override
public List<TabSysUnionEnterpriseAuthResDetail> listUnionEnterpriseAuthResDetail(Integer unionEnterpriseAuthId, Integer authStatus) {
......@@ -51,6 +58,9 @@ public class UnionEnterpriseAuthResDetailServiceImpl implements UnionEnterpriseA
.setRemark("")
.setAuthKey("");
tabSysUnionEnterpriseAuthResDetailMapper.updateByPrimaryKeySelective(old);
//日志
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(unionEnterpriseAuthId,
old.getResourceType(), UnionEnterpriseAuthResOperateEnum.EDIT_RESOURCE_AREA.getMessage());
}
return;
}
......@@ -65,6 +75,25 @@ public class UnionEnterpriseAuthResDetailServiceImpl implements UnionEnterpriseA
.setResourceType(typeEnum.getCode())
.setAuthStatus(UnionEnterpriseAuthDetailStatusEnum.NO_AUTH.getCode());
tabSysUnionEnterpriseAuthResDetailMapper.insertSelective(record);
//日志
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(unionEnterpriseAuthId,
typeEnum.getCode(), UnionEnterpriseAuthResOperateEnum.UNION.getMessage());
}
}
@Override
public void relieveUnion(@NotNull Integer unionEnterpriseAuthId) {
List<TabSysUnionEnterpriseAuthResDetail> list = listUnionEnterpriseAuthResDetail(unionEnterpriseAuthId, null);
if (CollectionUtils.isNotEmpty(list)) {
for (TabSysUnionEnterpriseAuthResDetail temp : list) {
temp.setUpdateTime(new Date())
.setAuthStatus(UnionEnterpriseAuthDetailStatusEnum.TO_RELIEVE.getCode());
tabSysUnionEnterpriseAuthResDetailMapper.updateByPrimaryKeySelective(temp);
//日志
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(unionEnterpriseAuthId,
temp.getResourceType(), UnionEnterpriseAuthResOperateEnum.START_RELIEVE.getMessage());
}
}
}
......@@ -72,4 +101,15 @@ public class UnionEnterpriseAuthResDetailServiceImpl implements UnionEnterpriseA
public List<TabSysUnionEnterpriseAuthResDetail> listByUnionEnterpriseAuthIdList(List<Integer> unionEnterpriseAuthIdList) {
return tabSysUnionEnterpriseAuthResDetailMapper.listByUnionEnterpriseAuthIdList(unionEnterpriseAuthIdList);
}
@Override
public int union(@NotNull Integer unionEnterpriseAuthResDetailId, @NotNull Integer authStatus, String authKey, String remark) {
TabSysUnionEnterpriseAuthResDetail record = new TabSysUnionEnterpriseAuthResDetail();
record.setUpdateTime(new Date());
record.setUnionEnterpriseAuthResDetailId(unionEnterpriseAuthResDetailId);
record.setAuthKey(authKey);
record.setRemark(remark);
record.setAuthStatus(authStatus);
return tabSysUnionEnterpriseAuthResDetailMapper.updateByPrimaryKeySelective(record);
}
}
package com.gic.enterprise.service.impl;
import com.gic.enterprise.dao.mapper.TabSysUnionEnterpriseAuthResLogMapper;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog;
import com.gic.enterprise.qo.union.UnionEnterpriseAuthResLogQO;
import com.gic.enterprise.service.UnionEnterpriseAuthResLogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 资源操作日志
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/8 9:34 AM

*/
@Service("unionEnterpriseAuthResLogService")
public class UnionEnterpriseAuthResLogServiceImpl implements UnionEnterpriseAuthResLogService{
@Autowired
private TabSysUnionEnterpriseAuthResLogMapper tabSysUnionEnterpriseAuthResLogMapper;
@Override
public int saveUnionEnterpriseAuthResLog(Integer unionEnterpriseAuthId, Integer resourceType, String logContent) {
return saveUnionEnterpriseAuthResLog(unionEnterpriseAuthId, resourceType, logContent, null, null);
}
@Override
public int saveUnionEnterpriseAuthResLog(Integer unionEnterpriseAuthId, Integer resourceType, String logContent, Date dealStartTime, Date dealEndTime) {
TabSysUnionEnterpriseAuthResLog record = new TabSysUnionEnterpriseAuthResLog();
Date now = new Date();
record.setUpdateTime(now)
.setCreateTime(now)
.setDeleteFlag(0)
.setUnionEnterpriseAuthId(unionEnterpriseAuthId)
.setResourceType(resourceType)
.setLogContent(logContent)
.setDealEndTime(dealEndTime)
.setDealStartTime(dealStartTime);
return tabSysUnionEnterpriseAuthResLogMapper.insertSelective(record);
}
@Override
public Page<TabSysUnionEnterpriseAuthResLog> listUnionEnterpriseAuthResLog(UnionEnterpriseAuthResLogQO param) {
PageHelper.startPage(param.getPageNum(), param.getPageSize());
List<TabSysUnionEnterpriseAuthResLog> list = tabSysUnionEnterpriseAuthResLogMapper.listUnionEnterpriseAuthResLog(param);
return (Page<TabSysUnionEnterpriseAuthResLog>) list;
}
}
......@@ -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,20 @@ 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);
}
@Override
public List<TabSysUnionEnterpriseAuth> listAll() {
return tabSysUnionEnterpriseAuthMapper.listAll();
}
@Override
public List<TabSysUnionEnterpriseAuth> listUnionEnterpriseAuth(@NotNull Integer ownEnterpriseId) {
return tabSysUnionEnterpriseAuthMapper.listUnionEnterprise(ownEnterpriseId);
}
}
package com.gic.enterprise.service.outer.impl.union;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthDetailStatusEnum;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResOperateEnum;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResTypeEnum;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthStatusEnum;
import com.gic.enterprise.dto.union.UnionEnterpriseAuthDTO;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuth;
import com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResDetail;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.service.UnionEnterpriseAuthResDetailApiService;
import com.gic.enterprise.service.UnionEnterpriseAuthResDetailService;
import com.gic.enterprise.service.UnionEnterpriseAuthResLogService;
import com.gic.enterprise.service.UnionEnterpriseAuthService;
import org.apache.commons.collections.CollectionUtils;
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;
/**
* 联合资源回调接口
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/8 10:27 AM

*/
@Service("unionEnterpriseAuthResDetailApiService")
public class UnionEnterpriseAuthResDetailApiServiceImpl implements UnionEnterpriseAuthResDetailApiService{
@Autowired
private UnionEnterpriseAuthResDetailService unionEnterpriseAuthResDetailService;
@Autowired
private UnionEnterpriseAuthService unionEnterpriseAuthService;
@Autowired
private UnionEnterpriseAuthResLogService unionEnterpriseAuthResLogService;
@Override
public ServiceResponse<Void> authDataCallback() {
return null;
}
@Override
public ServiceResponse<Void> unionForStore(@NotNull Integer authStatus, @NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId,
String authKey, String remark) {
TabSysUnionEnterpriseAuth old = unionEnterpriseAuthService.getUnionEnterprise(ownEnterpriseId, unionEnterpriseId);
if (old == null) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "联合商户不存在");
}
TabSysUnionEnterpriseAuthResDetail detail = unionEnterpriseAuthResDetailService
.getUnionEnterpriseAuthResDetail(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode());
boolean isUnionSuccess = UnionEnterpriseAuthDetailStatusEnum.HAS_AUTH.getCode().equals(authStatus);
//日志
if (isUnionSuccess) {
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode(),
UnionEnterpriseAuthResOperateEnum.UNION.getMessage(), null, new Date());
} else {
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode(),
UnionEnterpriseAuthResOperateEnum.UNION.getMessage(), new Date(), null);
}
//如果是,则判断其他资源是否已经完成
if (isUnionSuccess && isAllDealSuccess(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode(), true)) {
//更新最新联合时间()
UnionEnterpriseAuthDTO dto = new UnionEnterpriseAuthDTO();
dto.setUnionEnterpriseAuthId(old.getUnionEnterpriseAuthId());
dto.setLastUnionTime(new Date());
unionEnterpriseAuthService.update(dto);
}
unionEnterpriseAuthResDetailService.union(detail.getUnionEnterpriseAuthResDetailId(), authStatus, authKey, remark);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> relieveForStore(@NotNull Integer authStatus, @NotNull Integer ownEnterpriseId, @NotNull Integer unionEnterpriseId) {
TabSysUnionEnterpriseAuth old = unionEnterpriseAuthService.getUnionEnterprise(ownEnterpriseId, unionEnterpriseId);
if (old == null) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "联合商户不存在");
}
TabSysUnionEnterpriseAuthResDetail detail = unionEnterpriseAuthResDetailService
.getUnionEnterpriseAuthResDetail(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode());
boolean isAllRelieveSuccess = UnionEnterpriseAuthDetailStatusEnum.HAS_RELIEVE.getCode().equals(authStatus);
if (isAllRelieveSuccess) {
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode(),
UnionEnterpriseAuthResOperateEnum.RELIEVED.getMessage(), null, new Date());
} else {
unionEnterpriseAuthResLogService.saveUnionEnterpriseAuthResLog(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode(),
UnionEnterpriseAuthResOperateEnum.RELIEVED.getMessage(), new Date(), null);
}
//如果是,则判断其他资源是否已经完成
UnionEnterpriseAuthDTO dto = new UnionEnterpriseAuthDTO();
dto.setUnionEnterpriseAuthId(old.getUnionEnterpriseAuthId());
if (isAllRelieveSuccess && isAllDealSuccess(old.getUnionEnterpriseAuthId(), UnionEnterpriseAuthResTypeEnum.STORE.getCode(), false)) {
//更新最新联合时间()
dto.setLastRelieveTime(new Date());
dto.setStatusFlag(UnionEnterpriseAuthStatusEnum.RELIEVED.getCode());
} else {
dto.setStatusFlag(UnionEnterpriseAuthStatusEnum.RELIEVING.getCode());
}
unionEnterpriseAuthService.update(dto);
unionEnterpriseAuthResDetailService.union(detail.getUnionEnterpriseAuthResDetailId(), authStatus, null, null);
return ServiceResponse.success();
}
private void unionCommon(Integer authStatus, Integer ownEnterpriseId, Integer unionEnterpriseId, String authKey, String remark) {
}
/**
* 其他资源是否授权成功/解除成功
* @param unionEnterpriseAuthId
* @param resourceType
* @param isUnion
* @return
*/
private boolean isAllDealSuccess(Integer unionEnterpriseAuthId, Integer resourceType, boolean isUnion) {
Integer authStatus = UnionEnterpriseAuthDetailStatusEnum.HAS_AUTH.getCode();
if (!isUnion) {
authStatus = UnionEnterpriseAuthDetailStatusEnum.HAS_RELIEVE.getCode();
}
boolean isAllDealSuccess = true;
List<TabSysUnionEnterpriseAuthResDetail> resList = unionEnterpriseAuthResDetailService.listUnionEnterpriseAuthResDetail(unionEnterpriseAuthId, null);
if (CollectionUtils.isNotEmpty(resList)) {
for (TabSysUnionEnterpriseAuthResDetail temp : resList) {
if (!temp.getResourceType().equals(resourceType) && !temp.getAuthStatus().equals(authStatus)) {
isAllDealSuccess = false;
}
}
}
return isAllDealSuccess;
}
}
......@@ -153,4 +153,5 @@
<dubbo:reference interface="com.gic.cloud.service.IndexDescApiService" id="indexDescApiService" timeout="6000" />
<dubbo:reference interface="com.gic.member.tag.api.service.SceneCrowdGroupApiService" id="sceneCrowdGroupApiService" timeout="6000" />
<dubbo:reference interface="com.gic.store.service.StoreWidgetApiService" id="storeWidgetApiService" timeout="6000" />
<dubbo:reference interface="com.gic.store.service.StoreAuthorizationApiService" id="storeAuthorizationApiService" timeout="6000" />
</beans>
......@@ -153,4 +153,10 @@
</if>
and strategy_name = #{strategyName}
</select>
<select id="deleteUnionEnterpriseAuthAppByUnionEnterpriseAuthId" resultType="integer">
update tab_sys_union_enterprise_auth_app set delete_flag = 1
where delete_flag = 0
and union_enterprise_auth_id = #{unionEnterpriseAuthId}
</select>
</mapper>
\ No newline at end of file
......@@ -279,4 +279,44 @@
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 startTime != ''">
and (last_union_time >= #{startTime} or last_relieve_time >= #{startTime})
</if>
<if test="endTime != null and endTime != ''">
and (last_union_time &lt;= #{endTime} or last_relieve_time &lt;= #{endTime})
</if>
and union_enterprise_id = #{unionEnterpriseId}
</select>
<select id="listAll" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_union_enterprise_auth
where delete_flag = 0
and status_flag = 4
</select>
<select id="listUnionEnterprise" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_union_enterprise_auth
where delete_flag = 0
and status_flag != 3
and own_enterprise_id = #{ownEnterpriseId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.enterprise.dao.mapper.TabSysUnionEnterpriseAuthResLogMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog">
<id column="union_enterprise_auth_res_log_id" jdbcType="INTEGER" property="unionEnterpriseAuthResLogId" />
<result column="union_enterprise_auth_id" jdbcType="INTEGER" property="unionEnterpriseAuthId" />
<result column="resource_type" jdbcType="INTEGER" property="resourceType" />
<result column="log_content" jdbcType="VARCHAR" property="logContent" />
<result column="deal_start_time" jdbcType="TIMESTAMP" property="dealStartTime" />
<result column="deal_end_time" jdbcType="TIMESTAMP" property="dealEndTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
union_enterprise_auth_res_log_id, union_enterprise_auth_id, resource_type, log_content,
deal_start_time, deal_end_time, create_time, update_time, delete_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_union_enterprise_auth_res_log
where union_enterprise_auth_res_log_id = #{unionEnterpriseAuthResLogId,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog">
insert into tab_sys_union_enterprise_auth_res_log (union_enterprise_auth_res_log_id, union_enterprise_auth_id,
resource_type, log_content, deal_start_time,
deal_end_time, create_time, update_time,
delete_flag)
values (#{unionEnterpriseAuthResLogId,jdbcType=INTEGER}, #{unionEnterpriseAuthId,jdbcType=INTEGER},
#{resourceType,jdbcType=INTEGER}, #{logContent,jdbcType=VARCHAR}, #{dealStartTime,jdbcType=TIMESTAMP},
#{dealEndTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{deleteFlag,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog">
insert into tab_sys_union_enterprise_auth_res_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="unionEnterpriseAuthResLogId != null">
union_enterprise_auth_res_log_id,
</if>
<if test="unionEnterpriseAuthId != null">
union_enterprise_auth_id,
</if>
<if test="resourceType != null">
resource_type,
</if>
<if test="logContent != null">
log_content,
</if>
<if test="dealStartTime != null">
deal_start_time,
</if>
<if test="dealEndTime != null">
deal_end_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="unionEnterpriseAuthResLogId != null">
#{unionEnterpriseAuthResLogId,jdbcType=INTEGER},
</if>
<if test="unionEnterpriseAuthId != null">
#{unionEnterpriseAuthId,jdbcType=INTEGER},
</if>
<if test="resourceType != null">
#{resourceType,jdbcType=INTEGER},
</if>
<if test="logContent != null">
#{logContent,jdbcType=VARCHAR},
</if>
<if test="dealStartTime != null">
#{dealStartTime,jdbcType=TIMESTAMP},
</if>
<if test="dealEndTime != null">
#{dealEndTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog">
update tab_sys_union_enterprise_auth_res_log
<set>
<if test="unionEnterpriseAuthId != null">
union_enterprise_auth_id = #{unionEnterpriseAuthId,jdbcType=INTEGER},
</if>
<if test="resourceType != null">
resource_type = #{resourceType,jdbcType=INTEGER},
</if>
<if test="logContent != null">
log_content = #{logContent,jdbcType=VARCHAR},
</if>
<if test="dealStartTime != null">
deal_start_time = #{dealStartTime,jdbcType=TIMESTAMP},
</if>
<if test="dealEndTime != null">
deal_end_time = #{dealEndTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set>
where union_enterprise_auth_res_log_id = #{unionEnterpriseAuthResLogId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabSysUnionEnterpriseAuthResLog">
update tab_sys_union_enterprise_auth_res_log
set union_enterprise_auth_id = #{unionEnterpriseAuthId,jdbcType=INTEGER},
resource_type = #{resourceType,jdbcType=INTEGER},
log_content = #{logContent,jdbcType=VARCHAR},
deal_start_time = #{dealStartTime,jdbcType=TIMESTAMP},
deal_end_time = #{dealEndTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where union_enterprise_auth_res_log_id = #{unionEnterpriseAuthResLogId,jdbcType=INTEGER}
</update>
<select id="listUnionEnterpriseAuthResLog" resultMap="BaseResultMap" resultType="com.gic.enterprise.qo.union.UnionEnterpriseAuthResLogQO">
select <include refid="Base_Column_List"></include>
from tab_sys_union_enterprise_auth_res_log
where delete_flag = 0
and union_enterprise_auth_id = #{unionEnterpriseAuthId}
<if test="content != null">
and log_content like concat('%', #{content}, '%')
</if>
<if test="startTime">
and (deal_start_time >= #{startTime} or deal_end_time >= #{startTime})
</if>
<if test="endTime">
and (deal_start_time &lt;= #{endTime} or deal_end_time &lt;= #{endTime})
</if>
</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 +
'}';
}
}
......@@ -28,7 +28,9 @@ public class OwnEnterpriseListVO implements Serializable{
private String address;
private String enterpriseId;
private Integer 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;
}
......@@ -109,11 +116,11 @@ public class OwnEnterpriseListVO implements Serializable{
return this;
}
public String getEnterpriseId() {
public Integer getEnterpriseId() {
return enterpriseId;
}
public OwnEnterpriseListVO setEnterpriseId(String enterpriseId) {
public OwnEnterpriseListVO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
......@@ -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 +
'}';
}
}
package com.gic.enterprise.web.vo.union;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResTypeEnum;
import java.io.Serializable;
import java.util.Date;
......@@ -24,7 +26,7 @@ public class OwnEnterpriseOperationLogVO implements Serializable{
private Date dealEndTime;
public String getResourceTypeName() {
return resourceTypeName;
return UnionEnterpriseAuthResTypeEnum.getMessage(resourceType);
}
public OwnEnterpriseOperationLogVO setResourceTypeName(String resourceTypeName) {
......
......@@ -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 +
......
package com.gic.enterprise.web.vo.union;
import com.gic.enterprise.constant.union.UnionEnterpriseAuthResTypeEnum;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 联合商户首页显示自有商户列表
* @ClassName:
* @Description: 

* @author guojuxing

* @date 2021/2/8 11:30 AM

*/
public class UnionEnterpriseIndexVO implements Serializable{
private static final long serialVersionUID = -7531909863237188767L;
private String userName;
private String phoneNumber;
/**
* 国际区号,如中国 86
*/
private String phoneAreaCode;
private String enterpriseName;
private String companyName;
private String address;
private Integer enterpriseId;
private String logo;
/**
* 最新联合完成时间(最后一项资源授权完毕时间
*/
private Date lastUnionTime;
private List<String> resourceName;
public String getUserName() {
return userName;
}
public UnionEnterpriseIndexVO setUserName(String userName) {
this.userName = userName;
return this;
}
public String getPhoneNumber() {
return phoneNumber;
}
public UnionEnterpriseIndexVO setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
public String getPhoneAreaCode() {
return phoneAreaCode;
}
public UnionEnterpriseIndexVO setPhoneAreaCode(String phoneAreaCode) {
this.phoneAreaCode = phoneAreaCode;
return this;
}
public String getEnterpriseName() {
return enterpriseName;
}
public UnionEnterpriseIndexVO setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
return this;
}
public String getCompanyName() {
return companyName;
}
public UnionEnterpriseIndexVO setCompanyName(String companyName) {
this.companyName = companyName;
return this;
}
public String getAddress() {
return address;
}
public UnionEnterpriseIndexVO setAddress(String address) {
this.address = address;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public UnionEnterpriseIndexVO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getLogo() {
return logo;
}
public UnionEnterpriseIndexVO setLogo(String logo) {
this.logo = logo;
return this;
}
public Date getLastUnionTime() {
return lastUnionTime;
}
public UnionEnterpriseIndexVO setLastUnionTime(Date lastUnionTime) {
this.lastUnionTime = lastUnionTime;
return this;
}
public List<String> getResourceName() {
List<String> result = new ArrayList<>();
for (UnionEnterpriseAuthResTypeEnum type : UnionEnterpriseAuthResTypeEnum.values()) {
result.add(type.getMessage());
}
return result;
}
public UnionEnterpriseIndexVO setResourceName(List<String> resourceName) {
this.resourceName = resourceName;
return this;
}
@Override
public String toString() {
return "UnionEnterpriseIndexVO{" +
"userName='" + userName + '\'' +
", phoneNumber='" + phoneNumber + '\'' +
", phoneAreaCode='" + phoneAreaCode + '\'' +
", enterpriseName='" + enterpriseName + '\'' +
", companyName='" + companyName + '\'' +
", address='" + address + '\'' +
", enterpriseId='" + enterpriseId + '\'' +
", logo='" + logo + '\'' +
", lastUnionTime=" + lastUnionTime +
", resourceName=" + resourceName +
'}';
}
}
......@@ -29,7 +29,7 @@ public class UnionEnterpriseListVO implements Serializable{
private String address;
private String enterpriseId;
private Integer enterpriseId;
/**
* 1:有效 2:解除中 3: 已解除联合 4:待解除
......@@ -160,11 +160,11 @@ public class UnionEnterpriseListVO implements Serializable{
return this;
}
public String getEnterpriseId() {
public Integer getEnterpriseId() {
return enterpriseId;
}
public UnionEnterpriseListVO setEnterpriseId(String enterpriseId) {
public UnionEnterpriseListVO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
......
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