mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-08 23:38:57 +08:00
支付功能
This commit is contained in:
@@ -55,7 +55,6 @@ public interface LogMoneyMapper extends IBaseMapper<LogMoney> {
|
||||
logMoney.setExtra(extra);
|
||||
logMoney.setCreateTime(System.currentTimeMillis() / 1000);
|
||||
logMoney.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
System.out.println("呵呵呵呵");
|
||||
this.insert(logMoney);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,38 @@
|
||||
package com.mdd.common.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mdd.common.core.basics.IBaseMapper;
|
||||
import com.mdd.common.entity.RechargeOrder;
|
||||
import com.mdd.common.util.TimeUtils;
|
||||
import com.mdd.common.util.ToolUtils;
|
||||
|
||||
/**
|
||||
* 充值订单Mapper
|
||||
*/
|
||||
public interface RechargeOrderMapper extends IBaseMapper<RechargeOrder> {
|
||||
|
||||
/**
|
||||
* 生成唯一单号
|
||||
*
|
||||
* @author fzr
|
||||
* @param field 字段名
|
||||
* @return String
|
||||
*/
|
||||
default String randMakeOrderSn(String field) {
|
||||
String date = TimeUtils.timestampToDate(System.currentTimeMillis()/1000, "yyyyMMddHHmmss");
|
||||
String sn;
|
||||
while (true) {
|
||||
sn = date + ToolUtils.randomInt(12);
|
||||
RechargeOrder snModel = this.selectOne(
|
||||
new QueryWrapper<RechargeOrder>()
|
||||
.select("id")
|
||||
.eq(field, sn)
|
||||
.last("limit 1"));
|
||||
if (snModel == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return sn;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user