zhengyiming
2025-03-21 6a5d66d21df56c4549648b259609419e357e9470
fix: 三期需求
7个文件已修改
390 ■■■■■ 已修改文件
packages/components/src/hooks/index.ts 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/utils/common.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeConstants.ts 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/core/src/lifeRechargeServices.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/LifePay.ts 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/UserRole.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/api/typings.d.ts 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/components/src/hooks/index.ts
@@ -127,7 +127,11 @@
      });
      res.data = res.data.map((x) => ({
        ...x,
        frontStatus: convertOrderFrontStatus(x.payStatus, x.lifePayOrderStatus),
        frontStatus: convertOrderFrontStatus(
          x.payStatus,
          x.lifePayOrderStatus,
          x.lifePayRefundStatus
        ),
      }));
      return res;
    },
packages/components/src/utils/common.ts
@@ -132,7 +132,7 @@
  lifePayOrderStatus?: LifeRechargeConstants.LifePayOrderStatusEnum
) {
  if (
    (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.待确认 &&
    (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.充值中 &&
      payStatus === LifeRechargeConstants.LifePayStatusEnum.已支付) ||
    payStatus === LifeRechargeConstants.LifePayStatusEnum.待退款
  ) {
@@ -152,10 +152,11 @@
export function convertOrderFrontStatus(
  payStatus?: LifeRechargeConstants.LifePayStatusEnum,
  lifePayOrderStatus?: LifeRechargeConstants.LifePayOrderStatusEnum
  lifePayOrderStatus?: LifeRechargeConstants.LifePayOrderStatusEnum,
  lifePayRefundStatus?: LifeRechargeConstants.LifePayRefundStatusEnum
) {
  if (
    (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.待确认 &&
    (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.充值中 &&
      payStatus === LifeRechargeConstants.LifePayStatusEnum.已支付) ||
    payStatus === LifeRechargeConstants.LifePayStatusEnum.待退款
  ) {
@@ -167,10 +168,13 @@
  ) {
    return LifeRechargeConstants.LifePayOrderFrontStatusEnum.已退款;
  }
  if (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.退款待审核) {
  if (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.退款中) {
    return LifeRechargeConstants.LifePayOrderFrontStatusEnum.退款待审核;
  }
  if (lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.退款失败) {
  if (
    lifePayOrderStatus === LifeRechargeConstants.LifePayOrderStatusEnum.退款失败 ||
    lifePayRefundStatus === LifeRechargeConstants.LifePayRefundStatusEnum.退款驳回
  ) {
    return LifeRechargeConstants.LifePayOrderFrontStatusEnum.退款失败;
  }
  if (
packages/core/src/lifeRechargeConstants.ts
@@ -35,26 +35,28 @@
  }
  export enum LifePayOrderStatusEnum {
    待确认 = 10,
    充值中 = 10,
    已失败 = 20,
    // 已失败 = 20,
    已完成 = 30,
    退款待审核 = 40,
    待退款 = 40,
    已退款 = 50,
    退款失败 = 60,
    退款中 = 70,
  }
  export const LifePayOrderStatusEnumText = {
    [LifePayOrderStatusEnum.待确认]: '待确认',
    [LifePayOrderStatusEnum.已失败]: '已失败',
    [LifePayOrderStatusEnum.充值中]: '充值中',
    // [LifePayOrderStatusEnum.已失败]: '已失败',
    [LifePayOrderStatusEnum.已完成]: '已完成',
    [LifePayOrderStatusEnum.退款待审核]: '退款待审核',
    [LifePayOrderStatusEnum.待退款]: '待退款',
    [LifePayOrderStatusEnum.已退款]: '已退款',
    [LifePayOrderStatusEnum.退款失败]: '退款失败',
    [LifePayOrderStatusEnum.退款中]: '退款中',
  };
  export enum LifePayOrderFrontStatusEnum {
@@ -158,4 +160,22 @@
     */
    WXContent,
  }
  /**平台退款状态 */
  export enum LifePayRefundStatusEnum {
    无需退款 = 0,
    待退款 = 10,
    退款中 = 20,
    已退款 = 30,
    退款驳回 = 40,
  }
  export enum ACOOLYStatusEnum {
    充值中 = 10,
    充值成功 = 20,
    已完成 = 30,
    部分充值成功 = 40,
    充值失败 = 50,
    已退款 = 60,
  }
}
packages/core/src/lifeRechargeServices.ts
@@ -509,6 +509,8 @@
  /** 渠道流水号 */
  acoolyOrderNo?: string;
  frontStatus?: LifeRechargeConstants.LifePayOrderFrontStatusEnum;
  lifePayRefundStatus?: LifeRechargeConstants.LifePayRefundStatusEnum;
  acoolyStatus?: LifeRechargeConstants.ACOOLYStatusEnum;
}
export interface ElectricSupportAreaResponse {
packages/services/api/LifePay.ts
@@ -161,6 +161,21 @@
  });
}
/** 此处后端没有提供注释 GET /api/LifePay/GetBillErceiptExport */
export async function getBillErceiptExport(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetBillErceiptExportParams,
  options?: API.RequestConfig
) {
  return request<string>('/api/LifePay/GetBillErceiptExport', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取电费面值 POST /api/LifePay/GetElectricParValue */
export async function getElectricParValue(
  body: API.ChannelsBaseInput,
@@ -265,6 +280,21 @@
  });
}
/** 获取订单详情 GET /api/LifePay/GetLifePayOrderDetail */
export async function getLifePayOrderDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetLifePayOrderDetailParams,
  options?: API.RequestConfig
) {
  return request<API.LifePayOrderOutput>('/api/LifePay/GetLifePayOrderDetail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取订单分页数据 POST /api/LifePay/GetLifePayOrderPage */
export async function getLifePayOrderPage(
  body: API.QueryLifePayOrderListInput,
@@ -286,6 +316,36 @@
  options?: API.RequestConfig
) {
  return request<any>('/api/LifePay/GetLifePayOrderPageExport', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 获取退款订单详情 GET /api/LifePay/GetLifePayRefundOrderDetail */
export async function getLifePayRefundOrderDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetLifePayRefundOrderDetailParams,
  options?: API.RequestConfig
) {
  return request<API.LifePayRefundOrderOutput>('/api/LifePay/GetLifePayRefundOrderDetail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取退款订单分页数据 POST /api/LifePay/GetLifePayRefundOrderPage */
export async function getLifePayRefundOrderPage(
  body: API.QueryLifePayRefundOrderListInput,
  options?: API.RequestConfig
) {
  return request<API.LifePayOrderListOutputPageOutput>('/api/LifePay/GetLifePayRefundOrderPage', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
@@ -348,6 +408,14 @@
/** 获取折扣 GET /api/LifePay/GetRate */
export async function getRate(options?: API.RequestConfig) {
  return request<API.LifePayRateListOutput[]>('/api/LifePay/GetRate', {
    method: 'GET',
    ...(options || {}),
  });
}
/** 获取顶部统计数据 GET /api/LifePay/GetTopStatistics */
export async function getTopStatistics(options?: API.RequestConfig) {
  return request<API.TopStatisticsOutput>('/api/LifePay/GetTopStatistics', {
    method: 'GET',
    ...(options || {}),
  });
@@ -444,7 +512,7 @@
}
/** 获取用户分页数据 POST /api/LifePay/GetUserPage */
export async function getUserPage(body: API.PageInput, options?: API.RequestConfig) {
export async function getUserPage(body: API.QueryUserPageInput, options?: API.RequestConfig) {
  return request<API.UserListOutputPageOutput>('/api/LifePay/GetUserPage', {
    method: 'POST',
    headers: {
packages/services/api/UserRole.ts
@@ -86,6 +86,21 @@
  });
}
/** 重置密码 POST /api/UserRole/ResetUserPassword */
export async function resetUserPassword(
  body: API.ResetPasswordBaseInput,
  options?: API.RequestConfig
) {
  return request<number>('/api/UserRole/ResetUserPassword', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 角色启用/禁用 POST /api/UserRole/RoleEnableOrForbid */
export async function roleEnableOrForbid(
  body: API.RoleEnableOrForbidInput,
packages/services/api/typings.d.ts
@@ -15,6 +15,8 @@
    scope?: string;
  }
  type ACOOLYStatusEnum = 10 | 20 | 30 | 40 | 50 | 60;
  interface ActionApiDescriptionModel {
    uniqueName?: string;
    name?: string;
@@ -152,6 +154,10 @@
    moduleId?: string;
  }
  interface APIgetBillErceiptExportParams {
    orderNo?: string;
  }
  interface APIgetCountParams {
    filter?: string;
  }
@@ -174,6 +180,14 @@
  interface APIgetLifePayChannlesDtoParams {
    id?: string;
  }
  interface APIgetLifePayOrderDetailParams {
    orderNo?: string;
  }
  interface APIgetLifePayRefundOrderDetailParams {
    orderNo?: string;
  }
  interface APIgetLifePayWxIndentityParams {
@@ -444,11 +458,14 @@
    name?: string;
    /** 手机号 */
    phoneNumber?: string;
    password?: string;
    /** 账户 */
    userName?: string;
    remark?: string;
    /** 角色 */
    roleNames?: string[];
    /** 渠道列表 */
    channlesId?: string[];
    /** 组织架构公司id */
    companyOrgId?: string;
    /** 组织架构部门id */
@@ -1054,12 +1071,16 @@
    orderNo?: string;
    /** 充值金额 */
    rechargeAmount?: number;
    /** 实际充值金额 */
    actualRechargeAmount?: number;
    /** 优惠金额 */
    discountAmount?: number;
    /** 实付金额 */
    payAmount?: number;
    /** 支付时间 */
    payTime?: string;
    /** 平台扣款金额 */
    platformDeductionAmount?: number;
    payStatus?: LifePayStatusEnum;
    /** 外部订单号 */
    outOrderNo?: string;
@@ -1068,13 +1089,22 @@
    finishTime?: string;
    /** 退款凭证 */
    refundCredentialsImgUrl?: string;
    /** 退款金额 */
    refundPrice?: number;
    /** 下单时间 */
    creationTime?: string;
    /** 退款时间 */
    refundTime?: string;
    /** 申请退款原因 */
    refundApplyRemark?: string;
    /** 退款申请时间 */
    refundApplyTime?: string;
    /** 驳回原因 */
    refundCheckRemark?: string;
    /** 供应商订单号 */
    acoolyOrderNo?: string;
    acoolyStatus?: ACOOLYStatusEnum;
    lifePayRefundStatus?: LifePayRefundStatusEnum;
  }
  interface LifePayOrderListOutputPageOutput {
@@ -1083,7 +1113,76 @@
    data?: LifePayOrderListOutput[];
  }
  type LifePayOrderStatusEnum = 10 | 20 | 30 | 40 | 50 | 60;
  interface LifePayOrderOutput {
    id?: string;
    /** 用户账号 */
    userPhoneNumber?: string;
    userName?: string;
    lifePayChannle?: string;
    lifePayType?: LifePayTypeEnum;
    lifePayOrderType?: LifePayOrderTypeEnum;
    /** 退款订单号 */
    refundOrderNo?: string;
    /** 订单号 */
    orderNo?: string;
    /** 充值金额 */
    rechargeAmount?: number;
    /** 优惠金额 */
    discountAmount?: number;
    /** 实付金额 */
    payAmount?: number;
    /** 支付时间 */
    payTime?: string;
    payStatus?: LifePayStatusEnum;
    status?: LifePayOrderStatusEnum;
    /** 完成时间 */
    finishTime?: string;
    /** 外部订单号 */
    outOrderNo?: string;
    /** 订单详细数据 */
    orderParamDetailJsonStr?: string;
    /** 下单时间 */
    creationTime?: string;
    /** 退款时间 */
    refundTime?: string;
    /** 退款凭证 */
    refundCredentialsImgUrl?: string;
    /** 退款原因 */
    refundApplyRemark?: string;
    /** 驳回原因 */
    refundCheckRemark?: string;
    /** 渠道流水号 */
    acoolyOrderNo?: string;
    lifePayRefundStatus?: LifePayRefundStatusEnum;
    /** 实际充值金额 */
    actualRechargeAmount?: number;
    /** 实际到账金额 */
    actualReceivedAmount?: number;
    /** 退款金额 */
    refundPrice?: number;
    /** 平台折扣比例 */
    platformRate?: number;
    /** 平台扣款金额 */
    platformPrice?: number;
    /** 渠道折扣 */
    channleRate?: number;
    /** 渠道佣金比例 */
    channlesRakeRate?: number;
    /** 渠道佣金 */
    channlesRakePrice?: number;
    /** 手续费比例 */
    premiumRate?: number;
    /** 手续费 */
    premiumPrice?: number;
    /** 平台利润 */
    profit?: number;
    /** 回单地址 */
    elecBillUrl?: string;
    /** 退款回单地址 */
    refundElecBillUrl?: string;
  }
  type LifePayOrderStatusEnum = 10 | 20 | 30 | 40 | 50 | 60 | 70;
  type LifePayOrderTypeEnum = 10 | 20 | 30;
@@ -1120,7 +1219,64 @@
  type LifePayRateTypeEnum = 10 | 20 | 30 | 40;
  type LifePayStatusEnum = 10 | 20 | 30 | 40;
  interface LifePayRefundOrderOutput {
    id?: string;
    /** 用户账号 */
    userPhoneNumber?: string;
    userName?: string;
    lifePayChannle?: string;
    lifePayType?: LifePayTypeEnum;
    lifePayOrderType?: LifePayOrderTypeEnum;
    /** 订单号 */
    orderNo?: string;
    /** 充值金额 */
    rechargeAmount?: number;
    /** 优惠金额 */
    discountAmount?: number;
    /** 实付金额 */
    payAmount?: number;
    /** 支付时间 */
    payTime?: string;
    payStatus?: LifePayStatusEnum;
    status?: LifePayOrderStatusEnum;
    /** 完成时间 */
    finishTime?: string;
    /** 外部订单号 */
    outOrderNo?: string;
    /** 下单时间 */
    creationTime?: string;
    /** 退款时间 */
    refundTime?: string;
    /** 退款凭证 */
    refundCredentialsImgUrl?: string;
    /** 退款申请原因 */
    refundApplyRemark?: string;
    /** 退款申请时间 */
    refundApplyTime?: string;
    /** 退款驳回原因 */
    refundCheckRemark?: string;
    /** 退款订单号 */
    refundOrderNo?: string;
    /** 渠道流水号 */
    acoolyOrderNo?: string;
    lifePayRefundStatus?: LifePayRefundStatusEnum;
    /** 实际充值金额 */
    actualRechargeAmount?: number;
    /** 实际到账金额 */
    actualReceivedAmount?: number;
    /** 退款金额 */
    refundPrice?: number;
    /** 回单地址 */
    elecBillUrl?: string;
    /** 退款回单地址 */
    refundElecBillUrl?: string;
  }
  type LifePayRefundStatusEnum = 0 | 10 | 20 | 30 | 40;
  type LifePayRefundTypeEnum = 10 | 20;
  type LifePayStatusEnum = 10 | 20 | 30 | 40 | 50;
  type LifePaySwitchTypeEnum = 10 | 20 | 30;
@@ -1317,7 +1473,8 @@
    | 31
    | 32
    | 40
    | 42;
    | 42
    | 43;
  interface OrderInput {
    property?: string;
@@ -1444,11 +1601,34 @@
    /** 结束支付时间 */
    endPayTime?: string;
    payStatus?: LifePayStatusEnum;
    acoolyStatus?: ACOOLYStatusEnum;
    lifePayOrderStatus?: LifePayOrderStatusEnum;
    /** 开始完成时间 */
    beginFinishTime?: string;
    /** 结束完成时间 */
    endFinishTime?: string;
    /** 用户Id */
    userId?: string;
    /** 搜索关键词 */
    keyWords?: string;
  }
  interface QueryLifePayRefundOrderListInput {
    pageModel?: Pagination;
    checkChannelId?: string;
    lifePayOrderType?: LifePayOrderTypeEnum;
    lifePayType?: LifePayTypeEnum;
    /** 开始申请退款时间 */
    beginRefundApplyTime?: string;
    /** 结束申请退款时间 */
    endRefundApplyTime?: string;
    /** 开始完成时间 */
    beginFinishTime?: string;
    /** 结束完成时间 */
    endFinishTime?: string;
    payStatus?: LifePayStatusEnum;
    acoolyStatus?: ACOOLYStatusEnum;
    lifePayOrderStatus?: LifePayOrderStatusEnum;
    /** 用户Id */
    userId?: string;
    /** 搜索关键词 */
@@ -1477,10 +1657,25 @@
    lifePayOrderType?: LifePayOrderTypeEnum;
  }
  interface QueryUserPageInput {
    pageModel?: Pagination;
    checkChannelId?: string;
    /** 手机号/用户名 */
    queryCondition?: string;
    /** 注册时间 */
    creationTimeBegin?: string;
    creationTimeEnd?: string;
  }
  interface RefundLifePayOrderInput {
    id?: string;
    /** 上传凭证 */
    refundCredentialsImgUrl?: string;
    /** 退款驳回原因 */
    refundCheckRemark?: string;
    lifePayRefundType?: LifePayRefundTypeEnum;
    /** 退款金额 */
    refundPrice?: number;
  }
  interface RefundUserLifePayOrderInput {
@@ -1516,6 +1711,11 @@
  interface RemoteServiceValidationErrorInfo {
    message?: string;
    members?: string[];
  }
  interface ResetPasswordBaseInput {
    userId?: string;
    password?: string;
  }
  interface ResetPasswordDto {
@@ -1652,6 +1852,31 @@
    timeZone?: TimeZone;
  }
  interface TopStatisticsOutput {
    /** 创建时间 */
    creationTime?: string;
    /** 账户余额 */
    amount?: number;
    /** 累计收款 */
    accumulatedReceipts?: number;
    /** 昨日收款 */
    receiptsYesterday?: number;
    /** 累计收入 */
    accumulatedIncome?: number;
    /** 累计下单 */
    accumulatedOrders?: number;
    /** 昨日下单 */
    ordersNumYesterday?: number;
    /** 昨日成功 */
    yesterdaySuccess?: number;
    /** 昨日失败 */
    yesterdayFail?: number;
    /** 累计用户 */
    accumulatedUsers?: number;
    /** 昨日活跃用户 */
    yesterdayActiveUsers?: number;
  }
  interface TypeApiDescriptionModel {
    baseType?: string;
    isEnum?: boolean;
@@ -1666,11 +1891,14 @@
    name?: string;
    /** 手机号 */
    phoneNumber?: string;
    password?: string;
    /** 账户 */
    userName?: string;
    remark?: string;
    /** 角色 */
    roleNames?: string[];
    /** 渠道列表 */
    channlesId?: string[];
    /** 组织架构公司id */
    companyOrgId?: string;
    /** 组织架构部门id */
@@ -1743,6 +1971,13 @@
    data?: UserAccountOutput[];
  }
  interface UserChannleDto {
    /** 渠道Id */
    id?: string;
    /** 渠道名 */
    name?: string;
  }
  interface UserData {
    id?: string;
    tenantId?: string;
@@ -1778,6 +2013,8 @@
    isLocked?: boolean;
    /** 角色信息 */
    roles?: RoleDto[];
    /** 角色信息 */
    channles?: UserChannleDto[];
    /** 备注 */
    remark?: string;
    /** 组织架构公司id */
@@ -1822,6 +2059,8 @@
    refundCheckRemark?: string;
    /** 渠道流水号 */
    acoolyOrderNo?: string;
    lifePayRefundStatus?: LifePayRefundStatusEnum;
    acoolyStatus?: ACOOLYStatusEnum;
  }
  interface UserLifePayOrderOutputPageOutput {
@@ -1846,6 +2085,12 @@
    id?: string;
    /** 用户手机号 */
    phoneNumber?: string;
    /** 姓名 */
    name?: string;
    /** 最后登录渠道 */
    creationChannle?: string;
    /** 最后登录渠道 */
    lastLoginChannle?: string;
    lastLoginTime?: string;
    creationTime?: string;
  }