## 每天创建结算明细表;

This commit is contained in:
cabbage 2025-09-17 13:49:51 +08:00
parent d71c8ef105
commit 158c5e8a9b
5 changed files with 174 additions and 6 deletions

View File

@ -21,12 +21,26 @@ public interface CuMemberTreeMapper extends BaseMapper<CuMemberTree> {
void createCuMemberTreeTable(String tableName);
/**
* 创建会员网体结算记录表按照日记录每天一条记录30天的
* 创建会员结算记录表按照日记录每天一条
*
* @param tableName 日期
*/
void createCuMemberSettleTable(String tableName);
/**
* 创建结算明细表
*
* @param tableName
*/
void createCuMemberRetailDetail(String tableName);
/**
* 创建结算明细表会员索引
*
* @param tableName
*/
void createCuMemberRetailDetailMemberIndex(String tableName);
/*
* 创建会员网体复购极差结算表
**/

View File

@ -54,8 +54,13 @@ public class CuMemberTreeServiceImpl extends ServiceImpl<CuMemberTreeMapper, CuM
if (number == null || number <= 0) {
baseMapper.insertCuMemberRetailRangeByMember(retailRangeTableName);
}
// TODO 创建结算明细表
// 创建结算明细表
String retailRangeTableDetailName = TableNameConstants.CU_MEMBER_RETAIL_RANGE_DETAIL + period;;
number = baseMapper.queryExistOracleTable(retailRangeTableDetailName);
if (number == null || number <= 0) {
baseMapper.createCuMemberRetailDetail(retailRangeTableDetailName);
baseMapper.createCuMemberRetailDetailMemberIndex(retailRangeTableDetailName);
}
// 创建月表记录表
createMonthTreeTableName(date);

View File

@ -104,8 +104,7 @@
<!-- 会员网体月表数据,用于查询 网体跟业绩分开 横向分表-->
<sql id="CuMemberTreeColumn">
period
NUMBER(6) default 0 not null,
period NUMBER(6) default 0 not null,
pk_member NUMBER(20) not null,
pk_parent NUMBER(20) not null,
pk_place_parent NUMBER(20),
@ -289,6 +288,60 @@
)
</update>
<!-- 创建结算明细表 -->
<update id="createCuMemberRetailDetail">
create table ${tableName}
(
pk_id NUMBER(20) primary key,
pk_member NUMBER(20) not null,
child_node NUMBER(8) not null,
pk_parent NUMBER(20) not null,
stage NUMBER(1) default 1 not null,
stage_status NUMBER(1) default 1 not null,
stage_date DATE,
point_11 NUMBER(20),
point_12 NUMBER(20),
point_21 NUMBER(20),
point_22 NUMBER(20),
point_23 NUMBER(20),
point_24 NUMBER(20),
point_31 NUMBER(20),
point_32 NUMBER(20),
point_33 NUMBER(20),
point_34 NUMBER(20),
point_35 NUMBER(20),
point_36 NUMBER(20),
point_37 NUMBER(20),
point_38 NUMBER(20),
point_member_11 NUMBER(20),
point_member_12 NUMBER(20),
point_member_21 NUMBER(20),
point_member_22 NUMBER(20),
point_member_23 NUMBER(20),
point_member_24 NUMBER(20),
point_member_31 NUMBER(20),
point_member_32 NUMBER(20),
point_member_33 NUMBER(20),
point_member_34 NUMBER(20),
point_member_35 NUMBER(20),
point_member_36 NUMBER(20),
point_member_37 NUMBER(20),
point_member_38 NUMBER(20),
point_type NUMBER(1) default 0 not null,
point_gift NUMBER(1) default 0 not null,
creation_time DATE
)
</update>
<!-- 创建结算明细表会员索引 -->
<update id="createCuMemberRetailDetailMemberIndex">
create index ${tableName}_MEMBER
on ${tableName}
(
PK_MEMBER
)
</update>
<update id="createCuMemberTreeParentIndex">
create index ${tableName}_parent
on

View File

@ -31,9 +31,13 @@ public class TableNameConstants {
public static final String CU_MEMBER_SETTLE = "cu_member_settle";
/**
* 会员级差计算表
* 会员算表
*/
public static final String CU_MEMBER_RETAIL_RANGE = "CU_MEMBER_RETAIL";
/**
* 会员结算明细表
*/
public static final String CU_MEMBER_RETAIL_RANGE_DETAIL = "CU_MEMBER_RETAIL_DETAIL";
/**
* 会员结算秒结表

View File

@ -7,6 +7,8 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzs.common.core.annotation.Excel;
import com.hzs.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -147,6 +149,90 @@ public class CuMemberRetailDetail extends BaseEntity {
@TableField("POINT_38")
private Long point38;
/**
* 点位1-1会员
*/
@TableField("POINT_MEMBER_11")
private Long pointMember11;
/**
* 点位1-2会员
*/
@TableField("POINT_MEMBER_12")
private Long pointMember12;
/**
* 点位2-1会员
*/
@TableField("POINT_MEMBER_21")
private Long pointMember21;
/**
* 点位2-2会员
*/
@TableField("POINT_MEMBER_22")
private Long pointMember22;
/**
* 点位2-3会员
*/
@TableField("POINT_MEMBER_23")
private Long pointMember23;
/**
* 点位2-4会员
*/
@TableField("POINT_MEMBER_24")
private Long pointMember24;
/**
* 点位3-1会员
*/
@TableField("POINT_MEMBER_31")
private Long pointMember31;
/**
* 点位3-2会员
*/
@TableField("POINT_MEMBER_32")
private Long pointMember32;
/**
* 点位3-3会员
*/
@TableField("POINT_MEMBER_33")
private Long pointMember33;
/**
* 点位3-4会员
*/
@TableField("POINT_MEMBER_34")
private Long pointMember34;
/**
* 点位3-5会员
*/
@TableField("POINT_MEMBER_35")
private Long pointMember35;
/**
* 点位3-6会员
*/
@TableField("POINT_MEMBER_36")
private Long pointMember36;
/**
* 点位3-7会员
*/
@TableField("POINT_MEMBER_37")
private Long pointMember37;
/**
* 点位3-8会员
*/
@TableField("POINT_MEMBER_38")
private Long pointMember38;
/**
* 点位类型0=普通1=赠送点位
*/
@ -159,5 +245,11 @@ public class CuMemberRetailDetail extends BaseEntity {
@TableField("POINT_GIFT")
private Integer pointGift;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField("CREATION_TIME")
private Date creationTime;
}