代理user_money_detail更换表
This commit is contained in:
parent
cc978f44e8
commit
5d9fe65e9b
|
|
@ -22,6 +22,8 @@ import com.sqx.modules.invite.service.InviteAwardService;
|
|||
import com.sqx.modules.invite.service.InviteMoneyService;
|
||||
import com.sqx.modules.invite.service.InviteService;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
|
||||
import com.sqx.modules.sys.service.SysUserMoneyDetailsService;
|
||||
import com.sqx.modules.sys.service.SysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -59,6 +61,11 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||
private SysUserService sysUserService;
|
||||
@Autowired
|
||||
private InviteAchievementService inviteAchievementService;
|
||||
private final SysUserMoneyDetailsService sysUserMoneyDetailsService;
|
||||
|
||||
public InviteServiceImpl(SysUserMoneyDetailsService sysUserMoneyDetailsService) {
|
||||
this.sysUserMoneyDetailsService = sysUserMoneyDetailsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils selectInviteList(int page, int limit, Integer state, Long userId) {
|
||||
|
|
@ -359,7 +366,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||
return result;
|
||||
}
|
||||
userMoneyService.updateSysAmount(1, sysUserEntity.getUserId(), sumMoney.doubleValue());
|
||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
||||
SysUserMoneyDetails userMoneyDetails = new SysUserMoneyDetails();
|
||||
userMoneyDetails.setSysUserId(sysUserEntity.getUserId());
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setMoney(sumMoney);
|
||||
|
|
@ -376,7 +383,7 @@ public class InviteServiceImpl extends ServiceImpl<InviteDao, Invite> implements
|
|||
}
|
||||
userMoneyDetails.setContent(title + ",到账佣金:" + sumMoney);
|
||||
userMoneyDetails.setMoneyType(1);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
sysUserMoneyDetailsService.save(userMoneyDetails);
|
||||
result.put("sysUserId", sysUserEntity.getUserId());
|
||||
result.put("qdMoney", sumMoney);
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ import com.sqx.modules.pay.entity.PayDetails;
|
|||
import com.sqx.modules.pay.wuyou.BaseResp;
|
||||
import com.sqx.modules.pay.wuyou.WuyouPay;
|
||||
import com.sqx.modules.sys.entity.SysUserEntity;
|
||||
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
|
||||
import com.sqx.modules.sys.service.SysUserMoneyDetailsService;
|
||||
import com.sqx.modules.sys.service.SysUserService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -78,12 +80,14 @@ public class TempOrdersTask {
|
|||
private String profiles;
|
||||
private final InviteAchievementService inviteAchievementService;
|
||||
private final CourseService courseService;
|
||||
private final SysUserMoneyDetailsService sysUserMoneyDetailsService;
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public TempOrdersTask(InviteAchievementService inviteAchievementService, CourseService courseService) {
|
||||
public TempOrdersTask(InviteAchievementService inviteAchievementService, CourseService courseService, SysUserMoneyDetailsService sysUserMoneyDetailsService) {
|
||||
this.inviteAchievementService = inviteAchievementService;
|
||||
this.courseService = courseService;
|
||||
this.sysUserMoneyDetailsService = sysUserMoneyDetailsService;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -244,12 +248,12 @@ public class TempOrdersTask {
|
|||
SysUserEntity sysUser = sysUserService.selectSysUserByQdCode(user.getQdCode());
|
||||
if (sysUser != null) {
|
||||
String qdAward = commonRepository.findOne(915).getValue();
|
||||
UserMoneyDetails userMoneyDetails4 = new UserMoneyDetails(
|
||||
SysUserMoneyDetails userMoneyDetails4 = new SysUserMoneyDetails(
|
||||
null, sysUser.getUserId(), null, "[分享达标额外奖励]", 6, 1, 2,
|
||||
new BigDecimal(qdAward), "推广人员首次达标,额外奖励现金红包" + qdAward, 2);
|
||||
|
||||
userMoneyService.updateSysAmount(1, sysUser.getUserId(), Double.parseDouble(qdAward));
|
||||
userMoneyDetailsService.save(userMoneyDetails4);
|
||||
sysUserMoneyDetailsService.save(userMoneyDetails4);
|
||||
|
||||
UserMoney userMoney = userMoneyService.selectSysUserMoneyByUserId(sysUser.getSysUserId());
|
||||
userMoney.setInviteIncomeMoney(userMoney.getInviteIncomeMoney().add(new BigDecimal(qdAward)));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,188 @@
|
|||
package com.sqx.modules.sys.entity;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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 java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 钱包记录表
|
||||
* @TableName sys_user_money_details
|
||||
*/
|
||||
@TableName(value ="sys_user_money_details")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysUserMoneyDetails implements Serializable {
|
||||
|
||||
public SysUserMoneyDetails(Long userId, Long sysUserId, Long byUserId, String title, Integer classify, Integer type,
|
||||
Integer state, BigDecimal money, String content, Integer moneyType) {
|
||||
this.userId = userId;
|
||||
this.sysUserId = sysUserId;
|
||||
this.byUserId = byUserId;
|
||||
this.title = title;
|
||||
this.classify = classify;
|
||||
this.type = type;
|
||||
this.state = state;
|
||||
this.money = money;
|
||||
this.content = content;
|
||||
this.createTime = DateUtil.now();
|
||||
this.moneyType = moneyType;
|
||||
}
|
||||
/**
|
||||
* 钱包详情id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 渠道用户id
|
||||
*/
|
||||
private Long sysUserId;
|
||||
|
||||
/**
|
||||
* 对应用户id
|
||||
*/
|
||||
private Long byUserId;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* /***
|
||||
* 1 注册 (上级)
|
||||
* 2 充值
|
||||
* 3 购买
|
||||
* 4 提现
|
||||
* 5 现金大转盘
|
||||
* 6 分享达标
|
||||
* 7 任务领取
|
||||
* 8 平台操作
|
||||
* 9 订单退款
|
||||
* 10 渠道推广
|
||||
*/
|
||||
private Integer classify;
|
||||
|
||||
/**
|
||||
* 类别(1充值2支出)
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 状态 1待支付 2已到账 3取消
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 金额类型: 1 红包,2金豆
|
||||
*/
|
||||
private Integer moneyType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 源id
|
||||
*/
|
||||
private Long sourceId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SysUserMoneyDetails other = (SysUserMoneyDetails) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
|
||||
&& (this.getSysUserId() == null ? other.getSysUserId() == null : this.getSysUserId().equals(other.getSysUserId()))
|
||||
&& (this.getByUserId() == null ? other.getByUserId() == null : this.getByUserId().equals(other.getByUserId()))
|
||||
&& (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
|
||||
&& (this.getClassify() == null ? other.getClassify() == null : this.getClassify().equals(other.getClassify()))
|
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
|
||||
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
|
||||
&& (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(other.getMoney()))
|
||||
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
|
||||
&& (this.getMoneyType() == null ? other.getMoneyType() == null : this.getMoneyType().equals(other.getMoneyType()))
|
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
||||
&& (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
|
||||
result = prime * result + ((getSysUserId() == null) ? 0 : getSysUserId().hashCode());
|
||||
result = prime * result + ((getByUserId() == null) ? 0 : getByUserId().hashCode());
|
||||
result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
|
||||
result = prime * result + ((getClassify() == null) ? 0 : getClassify().hashCode());
|
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
|
||||
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
|
||||
result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
|
||||
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
|
||||
result = prime * result + ((getMoneyType() == null) ? 0 : getMoneyType().hashCode());
|
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
||||
result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", userId=").append(userId);
|
||||
sb.append(", sysUserId=").append(sysUserId);
|
||||
sb.append(", byUserId=").append(byUserId);
|
||||
sb.append(", title=").append(title);
|
||||
sb.append(", classify=").append(classify);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", state=").append(state);
|
||||
sb.append(", money=").append(money);
|
||||
sb.append(", content=").append(content);
|
||||
sb.append(", moneyType=").append(moneyType);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", sourceId=").append(sourceId);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.sqx.modules.sys.mapper;
|
||||
|
||||
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【sys_user_money_details(钱包记录表)】的数据库操作Mapper
|
||||
* @createDate 2025-01-04 19:02:19
|
||||
* @Entity com.sqx.modules.sys.entity.SysUserMoneyDetails
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserMoneyDetailsMapper extends BaseMapper<SysUserMoneyDetails> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.sqx.modules.sys.service;
|
||||
|
||||
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【sys_user_money_details(钱包记录表)】的数据库操作Service
|
||||
* @createDate 2025-01-04 19:02:19
|
||||
*/
|
||||
public interface SysUserMoneyDetailsService extends IService<SysUserMoneyDetails> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.sqx.modules.sys.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.modules.sys.entity.SysUserMoneyDetails;
|
||||
import com.sqx.modules.sys.service.SysUserMoneyDetailsService;
|
||||
import com.sqx.modules.sys.mapper.SysUserMoneyDetailsMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【sys_user_money_details(钱包记录表)】的数据库操作Service实现
|
||||
* @createDate 2025-01-04 19:02:19
|
||||
*/
|
||||
@Service
|
||||
public class SysUserMoneyDetailsServiceImpl extends ServiceImpl<SysUserMoneyDetailsMapper, SysUserMoneyDetails>
|
||||
implements SysUserMoneyDetailsService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?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.sqx.modules.sys.mapper.SysUserMoneyDetailsMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.sqx.modules.sys.entity.SysUserMoneyDetails">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="sysUserId" column="sys_user_id" jdbcType="INTEGER"/>
|
||||
<result property="byUserId" column="by_user_id" jdbcType="INTEGER"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="classify" column="classify" jdbcType="INTEGER"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="state" column="state" jdbcType="INTEGER"/>
|
||||
<result property="money" column="money" jdbcType="DECIMAL"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="moneyType" column="money_type" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="VARCHAR"/>
|
||||
<result property="sourceId" column="source_id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,sys_user_id,
|
||||
by_user_id,title,classify,
|
||||
type,state,money,
|
||||
content,money_type,create_time,
|
||||
source_id
|
||||
</sql>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue