Commit e79ecfd9 by 程裕兵

feat:settle

parent 8c4259df
/*
* Copyright © 2024 Hangzhou Jiejing Technology Co., Ltd. All rights reserved.
*
* The copyright of the company's program code belongs to Hangzhou Jiejing Technology Co., Ltd. No one can illegally copy it without the explicit permission of this website.
* Official website: www.xiaomai5.com
*
*
*
* Copyright © 2024 杭州杰竞科技有限公司 版权所有.
*
* 本公司程序代码的版权归杭州杰竞科技有限公司所有,未经本网站的明确许可,任何人不得非法复制。
* 官网: www.xiaomai5.com
*/
package com.jiejing.fitness.finance.repository.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* <p>
* 场馆结算记录
* </p>
*
* @author chengyubing, created on 2024-04-07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class StudioSettleRecord implements Serializable {
private static final long serialVersionUID = -1566792034500029034L;
/**
* 备注: 主键
* 是否允许为null: NO
*/
@TableId(value = "id", type = IdType.ID_WORKER)
private Long id;
/**
* 备注: 场馆ID
* 是否允许为null: YES
*/
private Long studioId;
/**
* 备注: 商户ID
* 是否允许为null: YES
*/
private Long merchantId;
/**
* 备注: 商户号
* 是否允许为null: YES
*/
private String mercahntNo;
/**
* 备注: 状态
* 是否允许为null: YES
*/
private String transState;
/**
* 备注: 结算金额(元)
* 是否允许为null: YES
*/
private BigDecimal transAmount;
/**
* 备注: 结算银行卡号
* 是否允许为null: YES
*/
private String cardNo;
/**
* 备注: 结算日期
* 是否允许为null: YES
*/
private Date settleDate;
/**
* 备注: 创建时间
* 是否允许为null: YES
*/
private Date createTime;
/**
* 备注: 更新时间
* 是否允许为null: YES
*/
private Date updateTime;
public static final String ID = "id";
public static final String STUDIO_ID = "studio_id";
public static final String MERCHANT_ID = "merchant_id";
public static final String MERCAHNT_NO = "mercahnt_no";
public static final String TRANS_STATE = "trans_state";
public static final String TRANS_AMOUNT = "trans_amount";
public static final String CARD_NO = "card_no";
public static final String SETTLE_DATE = "settle_date";
public static final String CREATE_TIME = "create_time";
public static final String UPDATE_TIME = "update_time";
}
/*
* Copyright © 2024 Hangzhou Jiejing Technology Co., Ltd. All rights reserved.
*
* The copyright of the company's program code belongs to Hangzhou Jiejing Technology Co., Ltd. No one can illegally copy it without the explicit permission of this website.
* Official website: www.xiaomai5.com
*
*
*
* Copyright © 2024 杭州杰竞科技有限公司 版权所有.
*
* 本公司程序代码的版权归杭州杰竞科技有限公司所有,未经本网站的明确许可,任何人不得非法复制。
* 官网: www.xiaomai5.com
*/
package com.jiejing.fitness.finance.repository.mapper;
import com.jiejing.fitness.finance.repository.entity.StudioSettleRecord;
import com.jiejing.mbp.inject.XBaseMapper;
/**
* <p>
* 场馆结算记录 Mapper 接口
* </p>
*
* @author chengyubing, created on 2024-04-07
*/
public interface StudioSettleRecordMapper extends XBaseMapper<StudioSettleRecord> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2024 Hangzhou Jiejing Technology Co., Ltd. All rights reserved.
~
~ The copyright of the company's program code belongs to Hangzhou Jiejing Technology Co., Ltd. No one can illegally copy it without the explicit permission of this website.
~ Official website: www.xiaomai5.com
~
~
~
~ Copyright © 2024 杭州杰竞科技有限公司 版权所有.
~
~ 本公司程序代码的版权归杭州杰竞科技有限公司所有,未经本网站的明确许可,任何人不得非法复制。
~ 官网: www.xiaomai5.com
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jiejing.fitness.finance.repository.mapper.StudioSettleRecordMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, studio_id, merchant_id, mercahnt_no, trans_state, trans_amount, card_no, settle_date, create_time, update_time
</sql>
</mapper>
/*
* Copyright © 2024 Hangzhou Jiejing Technology Co., Ltd. All rights reserved.
*
* The copyright of the company's program code belongs to Hangzhou Jiejing Technology Co., Ltd. No one can illegally copy it without the explicit permission of this website.
* Official website: www.xiaomai5.com
*
*
*
* Copyright © 2024 杭州杰竞科技有限公司 版权所有.
*
* 本公司程序代码的版权归杭州杰竞科技有限公司所有,未经本网站的明确许可,任何人不得非法复制。
* 官网: www.xiaomai5.com
*/
package com.jiejing.fitness.finance.repository.service;
import com.jiejing.fitness.finance.repository.entity.StudioSettleRecord;
import com.jiejing.fitness.finance.repository.mapper.StudioSettleRecordMapper;
import com.jiejing.mbp.MapperRepoService;
import org.springframework.stereotype.Service;
/**
* <p>
* 场馆结算记录 服务实现类
* </p>
*
* @author chengyubing, created on 2024-04-07
*/
@Service
public class StudioSettleRecordRpService extends MapperRepoService<Long, StudioSettleRecord, StudioSettleRecordMapper> {
}
......@@ -55,8 +55,9 @@ public class GeneratorServiceEntity {
// "studio_merchant_apply",
// "party_to_merchant",
// "brand_cashier_record"
"bank",
"branch_bank"
// "bank",
// "branch_bank",
"studio_settle_record"
};
/**
......
......@@ -9,6 +9,7 @@ import com.jiejing.fitness.finance.service.pay.PayService;
import com.jiejing.paycenter.common.event.MerchantEvent;
import com.jiejing.paycenter.common.event.PayEvent;
import com.jiejing.paycenter.common.event.RefundEvent;
import com.jiejing.paycenter.common.event.SettleEvent;
import com.xiaomai.event.annotation.EventHandler;
import java.util.ArrayList;
import java.util.Optional;
......@@ -66,6 +67,16 @@ public class ListenerService {
}
}
@EventHandler(value = SettleEvent.class, binder = "biz-kafka", maxAttempts = MAX_RETRY)
public void refundEventCallback(SettleEvent event, @Header(DELIVERY_ATTEMPT) int retryNum) {
try {
log.info("start process settle event {}", JSON.toJSONString(event));
payService.settleCallback(event);
} catch (Exception e) {
log.info("process settle event fail {}", JSON.toJSONString(event), e);
}
}
@EventHandler(value = RefundEvent.class, binder = "biz-kafka", maxAttempts = MAX_RETRY)
public void refundEventCallback(RefundEvent event, @Header(DELIVERY_ATTEMPT) int retryNum) {
......
......@@ -2,6 +2,7 @@ package com.jiejing.fitness.finance.service.pay;
import com.jiejing.fitness.finance.service.pay.params.StudioMerchantPayParams;
import com.jiejing.fitness.finance.service.pay.params.BrandMerchantRefundParams;
import com.jiejing.paycenter.common.event.SettleEvent;
import com.jiejing.paycenter.common.model.vo.PayVO;
import com.jiejing.paycenter.api.pay.vo.RefundVO;
import com.jiejing.paycenter.common.event.PayEvent;
......@@ -43,4 +44,11 @@ public interface PayService {
*/
void refundCallback(RefundEvent event);
/**
* 结算回调
*
* @param event 事件
*/
void settleCallback(SettleEvent event);
}
......@@ -13,6 +13,7 @@ import com.jiejing.fitness.finance.service.pay.params.StudioMerchantPayParams;
import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import com.jiejing.fitness.finance.service.rpc.PayRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.paycenter.common.event.SettleEvent;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.api.pay.request.PayRequest;
import com.jiejing.paycenter.api.pay.request.RefundPayRequest;
......@@ -113,4 +114,11 @@ public class PayServiceImpl implements PayService {
studioCashierRecordRpService.updateById(toModify);
}
@Override
public void settleCallback(SettleEvent event) {
// TODO
// 按照商户对总账
// 按照场馆拆分结算记录
}
}
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