初始化
This commit is contained in:
27
xuanyin-flow-team/pom.xml
Normal file
27
xuanyin-flow-team/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>accompany-boot</artifactId>
|
||||
<groupId>com.accompany</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>xuanyin-flow-team</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.accompany</groupId>
|
||||
<artifactId>accompany-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.accompany</groupId>
|
||||
<artifactId>accompany-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamConstant
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/12/16
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.constant;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/12/16]
|
||||
*/
|
||||
public class FlowTeamConstant {
|
||||
/**
|
||||
* 团队成员状态
|
||||
*/
|
||||
public static class MemberStatus {
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public final static Integer MEMBER_STATUS_DELETED = -1;
|
||||
/**
|
||||
* 无效
|
||||
*/
|
||||
public final static Integer MEMBER_STATUS_INVALID = 0;
|
||||
/**
|
||||
* 有效
|
||||
*/
|
||||
public final static Integer MEMBER_STATUS_VALID = 1;
|
||||
}
|
||||
|
||||
public static class TeamRole {
|
||||
// 成员
|
||||
public final static Integer MEMBER = 1;
|
||||
// 组长
|
||||
public final static Integer LEADER = 2;
|
||||
// 团长
|
||||
public final static Integer GROUP_LEADER = 3;
|
||||
|
||||
}
|
||||
|
||||
public static class FlowTeamInviteUserOptType {
|
||||
public final static Byte UPDATE = 1;
|
||||
public final static Byte DEL = 2;
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamSettlementDetail
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/15
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/15]
|
||||
*/
|
||||
@Data
|
||||
public class FlowTeamSettlementDetail {
|
||||
private Long erbanNo;
|
||||
private String nick;
|
||||
private Date createTime;
|
||||
private String inviteCode;
|
||||
private String inviteUserNick;
|
||||
private Date chargeTime;
|
||||
private Double amount;
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamGroupMapper
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/1/13
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamGroup;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/1/13]
|
||||
*/
|
||||
public interface FlowTeamGroupMapper extends BaseMapper<FlowTeamGroup> {
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInfoMapper
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/1/13
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInfo;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/1/13]
|
||||
*/
|
||||
public interface FlowTeamInfoMapper extends BaseMapper<FlowTeamInfo> {
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteCodeRecordMapper
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/24
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInviteCodeRecord;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/24]
|
||||
*/
|
||||
public interface FlowTeamInviteCodeRecordMapper extends BaseMapper<FlowTeamInviteCodeRecord> {
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteUserChangeRecordMapper
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/4/25
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInviteUserChangeRecord;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/4/25]
|
||||
*/
|
||||
public interface FlowTeamInviteUserChangeRecordMapper extends BaseMapper<FlowTeamInviteUserChangeRecord> {
|
||||
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMemberInviteCode;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface FlowTeamMemberInviteCodeMapper extends BaseMapper<FlowTeamMemberInviteCode> {
|
||||
|
||||
FlowTeamMemberInviteCode getByInviteCode(@Param("inviteCode") String inviteCode);
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamMemberInviteUserMapper
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/12/15
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMemberInviteUser;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/12/15]
|
||||
*/
|
||||
public interface FlowTeamMemberInviteUserMapper extends BaseMapper<FlowTeamMemberInviteUser> {
|
||||
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMember;
|
||||
|
||||
public interface FlowTeamMemberMapper extends BaseMapper<FlowTeamMember> {
|
||||
}
|
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamSettlementInfoMapper
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/11
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.mapper;
|
||||
|
||||
import com.xuanyin.flowteam.dto.FlowTeamSettlementDetail;
|
||||
import com.xuanyin.flowteam.model.FlowTeamSettlementInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/11]
|
||||
*/
|
||||
public interface FlowTeamSettlementInfoMapper extends BaseMapper<FlowTeamSettlementInfo> {
|
||||
/**
|
||||
* 获取小组结算数据
|
||||
* @param month 需要查询的月份 格式为 yyyy-MM
|
||||
* @param onlyQueryOld 是否只查询往月
|
||||
* @param teamId 需要查询的组id
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementInfo> listFlowTeamSettlementInfo(@Param("teamId") String teamId, @Param("onlyQueryOld") Boolean onlyQueryOld,
|
||||
@Param("month") String month);
|
||||
|
||||
/**
|
||||
* 获取小组某月结算详情
|
||||
*
|
||||
* @param teamId 需要查询的组id
|
||||
* @param month 需要查询的月份 格式为 yyyy-MM
|
||||
* @param erbanNo 需要查询的用户ID
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementDetail> listFlowTeamSettleDetail(@Param("teamId") String teamId, @Param("month") String month, @Param("erbanNo") String erbanNo);
|
||||
|
||||
List<String> listExsitDataTeamId();
|
||||
|
||||
/**
|
||||
* 获取小组结算数据 (根据小组-组员-用户固化关系查询)
|
||||
* @param month 需要查询的月份 格式为 yyyy-MM
|
||||
* @param teamId 需要查询的组ids
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementInfo> listFlowTeamSettlementInfoV2(@Param("teamIds") List<String> teamIds, @Param("month") String month,
|
||||
@Param("queryLimitTime") Date queryLimitTime
|
||||
);
|
||||
/**
|
||||
* 获取小组某月结算详情 (根据小组-组员-用户固化关系查询)
|
||||
*
|
||||
* @param teamIds 需要查询的组id
|
||||
* @param month 需要查询的月份 格式为 yyyy-MM
|
||||
* @param erbanNo 需要查询的用户ID
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementDetail> listFlowTeamSettleDetailV2(@Param("teamIds") List<String> teamIds, @Param("month") String month, @Param("erbanNo") String erbanNo);
|
||||
|
||||
/**
|
||||
* 获取小组某月结算详情 (根据小组-组员-用户固化关系查询)按照用户进行统总分组
|
||||
*
|
||||
* @param teamIds 需要查询的组id
|
||||
* @param month 需要查询的月份 格式为 yyyy-MM
|
||||
* @param erbanNo 需要查询的用户ID
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementDetail> listFlowTeamSettleDetailV3(@Param("teamIds") List<String> teamIds,
|
||||
@Param("month") String month, @Param("erbanNo") String erbanNo,
|
||||
@Param("queryLimitTime") Date queryLimitTime);
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamGroup
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/1/12
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/1/12]
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("flow_team_group")
|
||||
public class FlowTeamGroup {
|
||||
|
||||
@TableId(value = "group_id", type = IdType.AUTO)
|
||||
private Long groupId;
|
||||
@TableField(value = "group_name")
|
||||
private String groupName;
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamGroup
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/1/12
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/1/12]
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("flow_team_info")
|
||||
public class FlowTeamInfo {
|
||||
|
||||
@TableId(value = "team_id")
|
||||
private String teamId;
|
||||
@TableField(value = "team_name")
|
||||
private String teamName;
|
||||
@TableField(value = "group_id")
|
||||
private Long groupId;
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteCodeRecord
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/24
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/24]
|
||||
*/
|
||||
@Data
|
||||
@TableName("flow_team_invite_code_record")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FlowTeamInviteCodeRecord {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long Id;
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
@TableField(value = "invite_code")
|
||||
private String inviteCode;
|
||||
@TableField(value = "status")
|
||||
private Byte status;
|
||||
@TableField(value = "creator")
|
||||
private String creator;
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteUserChangeRecord
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/4/25
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/4/25]
|
||||
*/
|
||||
@Data
|
||||
@TableName("flow_team_invite_user_change_record")
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FlowTeamInviteUserChangeRecord {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long inviteRecordId;
|
||||
private Long groupId;
|
||||
private String teamId;
|
||||
private Long memberId ;
|
||||
private Long uid ;
|
||||
private String inviteCode;
|
||||
private Byte type;
|
||||
private Long operator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class FlowTeamMember implements Serializable {
|
||||
|
||||
@TableId(value = "member_id", type = IdType.AUTO)
|
||||
private Long memberId;
|
||||
|
||||
@TableField("member_name")
|
||||
private String memberName;
|
||||
|
||||
@TableField("member_phone")
|
||||
private String memberPhone;
|
||||
|
||||
@TableField("team_id")
|
||||
private String teamId;
|
||||
|
||||
@TableField("team_role")
|
||||
private Integer teamRole;
|
||||
|
||||
@TableField("member_status")
|
||||
private Integer memberStatus;
|
||||
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
|
||||
@TableField("update_time")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class FlowTeamMemberInviteCode implements Serializable {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@TableField("member_id")
|
||||
private Long memberId;
|
||||
|
||||
@TableField("invite_code")
|
||||
private String inviteCode;
|
||||
|
||||
@TableField("create_time")
|
||||
private Date createTime;
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamMemberInviteUser
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/12/15
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/12/15]
|
||||
*/
|
||||
@Data
|
||||
@TableName("flow_team_member_invite_user")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FlowTeamMemberInviteUser {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@TableField(value = "group_id")
|
||||
private Long groupId;
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
@TableField(value = "member_id")
|
||||
private Long memberId;
|
||||
@TableField(value = "invite_code")
|
||||
private String inviteCode;
|
||||
@TableField(value = "uid")
|
||||
private Long uid;
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
}
|
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamSettlementInfo
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/11
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/11]
|
||||
*/
|
||||
@Data
|
||||
@TableName("flow_team_settlement_info")
|
||||
public class FlowTeamSettlementInfo {
|
||||
|
||||
@TableField(value = "month")
|
||||
private String month;
|
||||
@TableField(value = "team_id")
|
||||
private String teamId;
|
||||
@TableField(value = "new_user_num")
|
||||
private Integer newUserNum;
|
||||
@TableField(value = "new_user_charge_amount")
|
||||
private Double newUserChargeAmount;
|
||||
@TableField(value = "total_charge_amount")
|
||||
private Double totalChargeAmount;
|
||||
@TableField(value = "total_charge_user_num")
|
||||
private Integer totalChargeUserNum;
|
||||
@TableField(value = "total_charge_num")
|
||||
private Integer totalChargeNum;
|
||||
@TableField(value = "create_time")
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamGroupService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/1/13
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamGroupMapper;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamInfoMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamGroup;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/1/13]
|
||||
*/
|
||||
@Service
|
||||
public class FlowTeamGroupService extends ServiceImpl<FlowTeamGroupMapper, FlowTeamGroup> {
|
||||
|
||||
@Autowired
|
||||
private FlowTeamInfoMapper flowTeamInfoMapper;
|
||||
|
||||
/**
|
||||
* 获取小组所属团队信息
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
public FlowTeamGroup getByTeamId(String teamId) {
|
||||
FlowTeamInfo flowTeamInfo = flowTeamInfoMapper.selectById(teamId);
|
||||
if (null == flowTeamInfo) {
|
||||
return null;
|
||||
}
|
||||
return getById(flowTeamInfo.getGroupId());
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInfoService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/1/13
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamInfoMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/1/13]
|
||||
*/
|
||||
@Service
|
||||
public class FlowTeamInfoService extends ServiceImpl<FlowTeamInfoMapper, FlowTeamInfo> {
|
||||
|
||||
public FlowTeamInfo getByTeamId(String teamId) {
|
||||
QueryWrapper<FlowTeamInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getTeamId, teamId)
|
||||
.eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
public List<FlowTeamInfo> listByGroupId(Long groupId) {
|
||||
QueryWrapper<FlowTeamInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInfo::getGroupId, groupId)
|
||||
.eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteCodeRecordService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/24
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInviteCodeRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/24]
|
||||
*/
|
||||
public interface FlowTeamInviteCodeRecordService extends IService<FlowTeamInviteCodeRecord> {
|
||||
FlowTeamInviteCodeRecord getByTeamIdAndCode(String teamId, String code);
|
||||
|
||||
/**
|
||||
* 获取小组生成的邀请码列表
|
||||
* @param teamIds
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamInviteCodeRecord> listTeamGenInviteCode(List<String> teamIds);
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteUserChangeRecordService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2022/4/25
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamInviteUserChangeRecordMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInviteUserChangeRecord;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2022/4/25]
|
||||
*/
|
||||
@Service
|
||||
public class FlowTeamInviteUserChangeRecordService extends ServiceImpl<FlowTeamInviteUserChangeRecordMapper, FlowTeamInviteUserChangeRecord> {
|
||||
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamMemberInviteCodeService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/12/15
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamMemberInviteCodeMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMemberInviteCode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/12/15]
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowTeamMemberInviteCodeService extends ServiceImpl<FlowTeamMemberInviteCodeMapper, FlowTeamMemberInviteCode> {
|
||||
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteCodeMapper flowTeamMemberInviteCodeMapper;
|
||||
|
||||
/**
|
||||
* 根据邀请码获取引流小组成员信息
|
||||
* @param inviteCode
|
||||
* @return
|
||||
*/
|
||||
public FlowTeamMemberInviteCode getByInviteCode(String inviteCode) {
|
||||
return flowTeamMemberInviteCodeMapper.getByInviteCode(inviteCode);
|
||||
}
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamMemberInviteUserBizService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/12/15
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInfo;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMember;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMemberInviteCode;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMemberInviteUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.security.acl.Group;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/12/15]
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowTeamMemberInviteUserBizService {
|
||||
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteCodeService flowTeamMemberInviteCodeService;
|
||||
@Autowired
|
||||
private FlowTeamMemberService flowTeamMemberService;
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteUserService flowTeamMemberInviteUserService;
|
||||
@Autowired
|
||||
private FlowTeamInfoService flowTeamInfoService;
|
||||
|
||||
/**
|
||||
* 保存引流小组成员与用户之间的邀请关系
|
||||
* @param inviteCode 邀请码
|
||||
* @param uid 被邀请用户uid
|
||||
*/
|
||||
@Async
|
||||
@Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager")
|
||||
public void saveFlowTeamMemberInviteUserAsync(String inviteCode, Long uid) {
|
||||
if (uid == null || StringUtils.isBlank(inviteCode)) {
|
||||
return;
|
||||
}
|
||||
// 根据邀请码查询对用的引流小组成员与当前所处小组信息
|
||||
FlowTeamMemberInviteCode flowTeamMemberInviteCode = flowTeamMemberInviteCodeService.getByInviteCode(inviteCode);
|
||||
if (flowTeamMemberInviteCode == null) {
|
||||
return;
|
||||
}
|
||||
Long memberId = flowTeamMemberInviteCode.getMemberId();
|
||||
FlowTeamMember flowTeamMember = flowTeamMemberService.getById(memberId);
|
||||
// 成员不存在或者成员不是有效状态,不绑定邀请关系
|
||||
if (null == flowTeamMember || !flowTeamMember.getMemberStatus().equals(FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID)) {
|
||||
return;
|
||||
}
|
||||
// 查询成员所在团队信息
|
||||
String teamId = flowTeamMember.getTeamId();
|
||||
FlowTeamInfo flowTeamInfo = flowTeamInfoService.getByTeamId(teamId);
|
||||
if (null == flowTeamInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
FlowTeamMemberInviteUser flowTeamMemberInviteUser = buildFlowTeamMemberInviteUser(flowTeamMember, inviteCode, uid, flowTeamInfo.getGroupId());
|
||||
flowTeamMemberInviteUserService.save(flowTeamMemberInviteUser);
|
||||
}
|
||||
|
||||
private FlowTeamMemberInviteUser buildFlowTeamMemberInviteUser(FlowTeamMember flowTeamMember, String inviteCode, Long uid, Long groupId) {
|
||||
return FlowTeamMemberInviteUser.builder().groupId(groupId).teamId(flowTeamMember.getTeamId())
|
||||
.memberId(flowTeamMember.getMemberId()).inviteCode(inviteCode).uid(uid)
|
||||
.createTime(new Date()).updateTime(new Date()).build();
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamMemberInviteUserService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/12/15
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamMemberInviteUserMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMemberInviteUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/12/15]
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowTeamMemberInviteUserService extends ServiceImpl<FlowTeamMemberInviteUserMapper, FlowTeamMemberInviteUser> {
|
||||
|
||||
public List<Long> listMemberIdByTeamId(List<String> teamIdList) {
|
||||
QueryWrapper<FlowTeamMemberInviteUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(FlowTeamMemberInviteUser::getTeamId, teamIdList);
|
||||
List<FlowTeamMemberInviteUser> list = list(queryWrapper);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
return list.stream().map(
|
||||
FlowTeamMemberInviteUser::getMemberId
|
||||
).collect(Collectors.toList());
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public FlowTeamMemberInviteUser getByUid(Long uid) {
|
||||
QueryWrapper<FlowTeamMemberInviteUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(FlowTeamMemberInviteUser::getUid, uid);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamMemberMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xuanyin.flowteam.model.FlowTeamMember;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FlowTeamMemberService extends ServiceImpl<FlowTeamMemberMapper, FlowTeamMember> {
|
||||
|
||||
/**
|
||||
* 根据账号获取用户组员信息
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
public List<FlowTeamMember> listMemberByPhone(String phone) {
|
||||
QueryWrapper<FlowTeamMember> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamMember::getMemberPhone, phone)
|
||||
.eq(FlowTeamMember::getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID)
|
||||
.eq(FlowTeamMember :: getTeamRole, FlowTeamConstant.TeamRole.MEMBER);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账号获取用户组员信息
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
public List<FlowTeamMember> listByPhone(String phone) {
|
||||
QueryWrapper<FlowTeamMember> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamMember::getMemberPhone, phone)
|
||||
.eq(FlowTeamMember::getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
public Integer countValidMember(String teamId) {
|
||||
QueryWrapper<FlowTeamMember> query = new QueryWrapper<>();
|
||||
query.lambda().eq(FlowTeamMember::getTeamId, teamId)
|
||||
.eq(FlowTeamMember::getMemberStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID);
|
||||
return count(query);
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamSettlementInfoService
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/11
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service;
|
||||
|
||||
import com.xuanyin.flowteam.model.FlowTeamSettlementInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>接口描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/11]
|
||||
*/
|
||||
public interface FlowTeamSettlementInfoService extends IService<FlowTeamSettlementInfo> {
|
||||
|
||||
/**
|
||||
* 获取小组往月的固化数据
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
List<FlowTeamSettlementInfo> listByTeamId(String teamId);
|
||||
|
||||
/**
|
||||
* 获取存在固化数据的小组id
|
||||
* @return
|
||||
*/
|
||||
List<String> listExsitDataTeamId();
|
||||
|
||||
/**
|
||||
* 异步固化小组上个月的结算数据
|
||||
* @param teamId
|
||||
*/
|
||||
void saveLastMonthSettlementDataAsync(String teamId);
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamInviteCodeRecordServiceImpl
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/24
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service.impl;
|
||||
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamInviteCodeRecordMapper;
|
||||
import com.xuanyin.flowteam.model.FlowTeamInviteCodeRecord;
|
||||
import com.xuanyin.flowteam.service.FlowTeamInviteCodeRecordService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/24]
|
||||
*/
|
||||
@Service
|
||||
public class FlowTeamInviteCodeRecordServiceImpl extends ServiceImpl<FlowTeamInviteCodeRecordMapper, FlowTeamInviteCodeRecord>
|
||||
implements FlowTeamInviteCodeRecordService {
|
||||
|
||||
@Override
|
||||
public FlowTeamInviteCodeRecord getByTeamIdAndCode(String teamId, String code) {
|
||||
QueryWrapper<FlowTeamInviteCodeRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamInviteCodeRecord :: getTeamId, teamId)
|
||||
.eq(FlowTeamInviteCodeRecord :: getInviteCode, code)
|
||||
.eq(FlowTeamInviteCodeRecord :: getStatus, Constant.status.valid);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowTeamInviteCodeRecord> listTeamGenInviteCode(List<String> teamIds) {
|
||||
QueryWrapper<FlowTeamInviteCodeRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(FlowTeamInviteCodeRecord :: getTeamId, teamIds)
|
||||
.eq(FlowTeamInviteCodeRecord :: getStatus, Constant.status.valid);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 文 件 名: FlowTeamSettlementInfoServiceImpl
|
||||
* 版 权:
|
||||
* 描 述: <描述>
|
||||
* 创建人: H1
|
||||
* 创建时间: 2021/11/11
|
||||
* 修改人:
|
||||
* 修改内容:
|
||||
* 修改时间:
|
||||
*/
|
||||
package com.xuanyin.flowteam.service.impl;
|
||||
|
||||
import com.xuanyin.flowteam.model.FlowTeamSettlementInfo;
|
||||
import com.xuanyin.flowteam.mapper.FlowTeamSettlementInfoMapper;
|
||||
import com.xuanyin.flowteam.service.FlowTeamSettlementInfoService;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.accompany.core.util.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <br>类描述:
|
||||
* <br>功能详细描述:
|
||||
*
|
||||
* @author H1
|
||||
* @date [2021/11/11]
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowTeamSettlementInfoServiceImpl extends ServiceImpl<FlowTeamSettlementInfoMapper, FlowTeamSettlementInfo>
|
||||
implements FlowTeamSettlementInfoService {
|
||||
|
||||
@Autowired
|
||||
private FlowTeamSettlementInfoMapper flowTeamSettlementInfoMapper;
|
||||
@Autowired
|
||||
private JedisLockService jedisLockService;
|
||||
|
||||
@Override
|
||||
public List<FlowTeamSettlementInfo> listByTeamId(String teamId) {
|
||||
QueryWrapper<FlowTeamSettlementInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamSettlementInfo::getTeamId, teamId);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listExsitDataTeamId() {
|
||||
return flowTeamSettlementInfoMapper.listExsitDataTeamId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void saveLastMonthSettlementDataAsync(String teamId) {
|
||||
if (StringUtils.isBlank(teamId)) {
|
||||
return;
|
||||
}
|
||||
Date now = new Date();
|
||||
String lastMonth = DateTimeUtil.convertDate(DateUtil.addMonths(now, -1), DateTimeUtil.DEFAULT_DATE_PATTERN_YEAR_MONTH);
|
||||
|
||||
FlowTeamSettlementInfo info = getByTeamIdAndMonth(teamId, lastMonth);
|
||||
if (null != info) {
|
||||
return;
|
||||
}
|
||||
String cacheKey = RedisKey.flow_team_settlement_init_lock.getKey(teamId);
|
||||
String lockKey = jedisLockService.lock(cacheKey, 3000, 10 * 1000);
|
||||
if (StringUtils.isBlank(lockKey)) {
|
||||
throw new ServiceException(BusiStatus.SERVER_BUSY);
|
||||
}
|
||||
try {
|
||||
info = getByTeamIdAndMonth(teamId, lastMonth);
|
||||
if (null != info) {
|
||||
return;
|
||||
}
|
||||
List<FlowTeamSettlementInfo> lastMonthSettlementInfo = flowTeamSettlementInfoMapper.listFlowTeamSettlementInfo(teamId, false, lastMonth);
|
||||
if (CollectionUtils.isEmpty(lastMonthSettlementInfo)) {
|
||||
return;
|
||||
}
|
||||
log.info("saveLastMonthSettlementDataAsync, teamId {} , month {}", teamId, lastMonth);
|
||||
saveBatch(lastMonthSettlementInfo);
|
||||
} catch (Exception e) {
|
||||
String message = "saveLastMonthSettlementDataAsync error, teamId :" + teamId + ", month :" + lastMonth;
|
||||
log.error(message, e);
|
||||
} finally {
|
||||
jedisLockService.unlock(cacheKey, lockKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private FlowTeamSettlementInfo getByTeamIdAndMonth(String teamId, String month) {
|
||||
QueryWrapper<FlowTeamSettlementInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(FlowTeamSettlementInfo::getTeamId, teamId).eq(FlowTeamSettlementInfo::getMonth, month);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?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.xuanyin.flowteam.mapper.FlowTeamMemberInviteCodeMapper">
|
||||
<select id="getByInviteCode" resultType="com.xuanyin.flowteam.model.FlowTeamMemberInviteCode">
|
||||
select fi.* from flow_team_member_invite_code fi, flow_team_member fm
|
||||
where fm.member_status != -1 and fi.member_id = fm.member_id
|
||||
and fi.invite_code = #{inviteCode};
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,217 @@
|
||||
<?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.xuanyin.flowteam.mapper.FlowTeamSettlementInfoMapper">
|
||||
<select id="listFlowTeamSettlementInfo" resultType="com.xuanyin.flowteam.model.FlowTeamSettlementInfo">
|
||||
select month, teamId, sum(a.newUserNum) newUserNum, sum(a.newUserChargeAmount) newUserChargeAmount,
|
||||
sum(a.totalChargeAmount) totalChargeAmount, sum(a.totalChargeUserNum) totalChargeUserNum, sum(a.totalChargeNum) totalChargeNum
|
||||
from (
|
||||
-- 小组N月新增用户概况
|
||||
select date_format(u.create_time, '%Y-%m') month, a.team_id teamId, count(distinct u.uid) newUserNum, 0 newUserChargeAmount,
|
||||
0 totalChargeAmount, 0 totalChargeUserNum, 0 totalChargeNum
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and team_id = #{teamId}
|
||||
</if>
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u
|
||||
where a.invite_code = u.invite_code
|
||||
and u.create_time >= a.create_time
|
||||
<if test="onlyQueryOld != null and onlyQueryOld">
|
||||
and date_format(u.create_time, '%Y-%m') < date_format(current_timestamp, '%Y-%m')
|
||||
</if>
|
||||
group by month, a.team_id
|
||||
union
|
||||
-- 小组N月新增用户充值概况
|
||||
select date_format(r.create_time, '%Y-%m') month, a.team_id teamId, 0 newUserNum
|
||||
, ifnull(sum(r.amount / 100), 0) newUserChargeAmount , 0 totalChargeAmount, 0 totalChargeUserNum, 0 totalChargeNum
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and team_id = #{teamId}
|
||||
</if>
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u, charge_record r
|
||||
where u.create_time >= a.create_time
|
||||
and a.invite_code = u.invite_code
|
||||
and u.uid = r.uid and r.charge_status = 2
|
||||
and r.charge_prod_id != 'exchange'
|
||||
and date_format(r.create_time, '%Y-%m') = date_format(u.create_time, '%Y-%m')
|
||||
<if test="onlyQueryOld != null and onlyQueryOld">
|
||||
and date_format(r.create_time, '%Y-%m') < date_format(current_timestamp, '%Y-%m')
|
||||
</if>
|
||||
group by month, a.team_id
|
||||
union
|
||||
-- 小组邀请所有用户在N月的充值概况
|
||||
select date_format(r.create_time, '%Y-%m') month, a.team_id teamId, 0 newUserNum ,
|
||||
0 newUserChargeAmount, ifnull(sum(r.amount/100), 0) totalChargeAmount,
|
||||
count(distinct r.uid) totalChargeUserNum, count(r.charge_record_id) totalChargeNum
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
<if test="teamId != null and teamId != ''">
|
||||
and team_id = #{teamId}
|
||||
</if>
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u , charge_record r
|
||||
where a.invite_code = u.invite_code
|
||||
and u.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and u.create_time >= a.create_time
|
||||
<if test="onlyQueryOld != null and onlyQueryOld">
|
||||
and date_format(r.create_time, '%Y-%m') < date_format(current_timestamp, '%Y-%m')
|
||||
</if>
|
||||
group by month, a.team_id) a
|
||||
group by a.month, a.teamId
|
||||
<if test="month != null and month != ''">
|
||||
having month = #{month}
|
||||
</if>
|
||||
order by a.teamId, a.month
|
||||
;
|
||||
</select>
|
||||
|
||||
<select id="listFlowTeamSettleDetail" resultType="com.xuanyin.flowteam.dto.FlowTeamSettlementDetail">
|
||||
select u.erban_no erbanNo, u.nick nick,
|
||||
u.create_time createTime, u.invite_code inviteCode,
|
||||
u2.nick inviteUserNick,
|
||||
r.create_time chargeTime, (r.amount /100) amount
|
||||
from
|
||||
(select fm.create_time , team_id, fi.invite_code
|
||||
from flow_team_member fm, flow_team_member_invite_code fi
|
||||
where member_status != -1
|
||||
and fm.member_id = fi.member_id
|
||||
and team_id = #{teamId}
|
||||
group by fm.create_time, team_id, fi.invite_code) a, users u , charge_record r, users u2
|
||||
where a.invite_code = u.invite_code
|
||||
and u.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and u.create_time >= a.create_time
|
||||
and u2.uid = u.invite_uid
|
||||
and date_format(r.create_time, '%Y-%m') = #{month}
|
||||
<if test="erbanNo != null and erbanNo != ''">
|
||||
and u.erban_no = #{erbanNo}
|
||||
</if>
|
||||
order by r.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="listExsitDataTeamId" resultType="java.lang.String">
|
||||
select team_id from flow_team_settlement_info group by team_id;
|
||||
</select>
|
||||
|
||||
<select id="listFlowTeamSettlementInfoV2" resultType="com.xuanyin.flowteam.model.FlowTeamSettlementInfo">
|
||||
select month, sum(a.newUserNum) newUserNum, sum(a.newUserChargeAmount) newUserChargeAmount,
|
||||
sum(a.totalChargeAmount) totalChargeAmount, sum(a.totalChargeUserNum) totalChargeUserNum, sum(a.totalChargeNum) totalChargeNum
|
||||
from (
|
||||
-- 小组N月新增用户概况
|
||||
select date_format(fm.create_time, '%Y-%m') month, count(distinct fm.uid) newUserNum, 0 newUserChargeAmount,
|
||||
0 totalChargeAmount, 0 totalChargeUserNum, 0 totalChargeNum
|
||||
from flow_team_member_invite_user fm
|
||||
where 1=1
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fm.team_id in
|
||||
<foreach collection="teamIds" item="teamId" open="(" close=")" separator=",">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by month
|
||||
union
|
||||
-- 小组N月新增用户充值概况
|
||||
select date_format(r.create_time, '%Y-%m') month, 0 newUserNum
|
||||
, ifnull(sum(r.amount / 100), 0) newUserChargeAmount , 0 totalChargeAmount, 0 totalChargeUserNum, 0 totalChargeNum
|
||||
from
|
||||
flow_team_member_invite_user fi, charge_record r
|
||||
where r.create_time >= fi.create_time
|
||||
and fi.uid = r.uid and r.charge_status = 2
|
||||
and r.charge_prod_id != 'exchange'
|
||||
and r.buss_type in (0,4)
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fi.team_id in
|
||||
<foreach collection="teamIds" item="teamId" open="(" close=")" separator=",">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</if>
|
||||
and date_format(r.create_time, '%Y-%m') = date_format(fi.create_time, '%Y-%m')
|
||||
group by month
|
||||
union
|
||||
-- 小组过去1年邀请的用户在N月的充值概况
|
||||
select date_format(r.create_time, '%Y-%m') month, 0 newUserNum ,
|
||||
0 newUserChargeAmount, ifnull(sum(r.amount/100), 0) totalChargeAmount,
|
||||
count(distinct r.uid) totalChargeUserNum, count(r.charge_record_id) totalChargeNum
|
||||
from
|
||||
flow_team_member_invite_user fi , charge_record r
|
||||
where fi.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and r.buss_type in (0,4)
|
||||
and r.create_time >= fi.create_time
|
||||
<if test="queryLimitTime != null">
|
||||
and fi.create_time >= #{queryLimitTime}
|
||||
</if>
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fi.team_id in
|
||||
<foreach collection="teamIds" item="teamId" open="(" close=")" separator=",">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</if>
|
||||
group by month, fi.team_id) a
|
||||
group by a.month
|
||||
<if test="month != null and month != ''">
|
||||
having month = #{month}
|
||||
</if>
|
||||
order by a.month
|
||||
;
|
||||
</select>
|
||||
|
||||
<select id="listFlowTeamSettleDetailV2" resultType="com.xuanyin.flowteam.dto.FlowTeamSettlementDetail">
|
||||
select u.erban_no erbanNo, u.nick nick,
|
||||
u.create_time createTime, u.invite_code inviteCode,
|
||||
fm.member_name inviteUserNick,
|
||||
r.create_time chargeTime, (r.amount /100) amount
|
||||
from
|
||||
charge_record r, flow_team_member fm, flow_team_member_invite_user fu
|
||||
left join users u on fu.uid = u.uid
|
||||
where fu.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and r.create_time >= fu.create_time
|
||||
and fm.member_id = fu.member_id
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fu.team_id in
|
||||
<foreach collection="teamIds" item="teamId" open="(" close=")" separator=",">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</if>
|
||||
and r.buss_type in (0,4)
|
||||
and date_format(r.create_time, '%Y-%m') = #{month}
|
||||
<if test="erbanNo != null and erbanNo != ''">
|
||||
and u.erban_no = #{erbanNo}
|
||||
</if> order by r.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="listFlowTeamSettleDetailV3" resultType="com.xuanyin.flowteam.dto.FlowTeamSettlementDetail">
|
||||
select u.erban_no erbanNo, u.nick nick,
|
||||
fu.create_time createTime, u.invite_code inviteCode,
|
||||
fm.member_name inviteUserNick,
|
||||
sum(r.amount /100) amount
|
||||
from
|
||||
charge_record r, flow_team_member fm, flow_team_member_invite_user fu
|
||||
left join users u on fu.uid = u.uid
|
||||
where fu.uid = r.uid and r.charge_status = 2 and r.charge_prod_id != 'exchange'
|
||||
and r.create_time >= fu.create_time
|
||||
and fm.member_id = fu.member_id
|
||||
<if test="teamIds != null and teamIds.size > 0">
|
||||
and fu.team_id in
|
||||
<foreach collection="teamIds" item="teamId" open="(" close=")" separator=",">
|
||||
#{teamId}
|
||||
</foreach>
|
||||
</if>
|
||||
and r.buss_type in (0,4)
|
||||
and date_format(r.create_time, '%Y-%m') = #{month}
|
||||
<if test="queryLimitTime != null and queryLimitTime != ''">
|
||||
and fu.create_time >= #{queryLimitTime}
|
||||
</if>
|
||||
<if test="erbanNo != null and erbanNo != ''">
|
||||
and u.erban_no = #{erbanNo}
|
||||
</if>
|
||||
group by erbanNo, nick, createTime, inviteCode, inviteUserNick
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user