用户引荐
This commit is contained in:
@ -0,0 +1,127 @@
|
||||
package com.ruoyi.baseUser.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseUserReferral;
|
||||
import com.ruoyi.baseUser.service.IZcBaseUserReferralService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 用户引荐信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-16
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/baseUser/referral")
|
||||
public class ZcBaseUserReferralController extends BaseController
|
||||
{
|
||||
private String prefix = "baseUser/referral";
|
||||
|
||||
@Autowired
|
||||
private IZcBaseUserReferralService zcBaseUserReferralService;
|
||||
|
||||
@RequiresPermissions("baseUser:referral:view")
|
||||
@GetMapping()
|
||||
public String referral()
|
||||
{
|
||||
return prefix + "/referral";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户引荐信息列表
|
||||
*/
|
||||
@RequiresPermissions("baseUser:referral:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
startPage();
|
||||
List<ZcBaseUserReferral> list = zcBaseUserReferralService.selectZcBaseUserReferralList(zcBaseUserReferral);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户引荐信息列表
|
||||
*/
|
||||
@RequiresPermissions("baseUser:referral:export")
|
||||
@Log(title = "用户引荐信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
List<ZcBaseUserReferral> list = zcBaseUserReferralService.selectZcBaseUserReferralList(zcBaseUserReferral);
|
||||
ExcelUtil<ZcBaseUserReferral> util = new ExcelUtil<ZcBaseUserReferral>(ZcBaseUserReferral.class);
|
||||
return util.exportExcel(list, "用户引荐信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户引荐信息
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存用户引荐信息
|
||||
*/
|
||||
@RequiresPermissions("baseUser:referral:add")
|
||||
@Log(title = "用户引荐信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
return toAjax(zcBaseUserReferralService.insertZcBaseUserReferral(zcBaseUserReferral));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户引荐信息
|
||||
*/
|
||||
@RequiresPermissions("baseUser:referral:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
ZcBaseUserReferral zcBaseUserReferral = zcBaseUserReferralService.selectZcBaseUserReferralById(id);
|
||||
mmap.put("zcBaseUserReferral", zcBaseUserReferral);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存用户引荐信息
|
||||
*/
|
||||
@RequiresPermissions("baseUser:referral:edit")
|
||||
@Log(title = "用户引荐信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
return toAjax(zcBaseUserReferralService.updateZcBaseUserReferral(zcBaseUserReferral));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户引荐信息
|
||||
*/
|
||||
@RequiresPermissions("baseUser:referral:remove")
|
||||
@Log(title = "用户引荐信息", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(zcBaseUserReferralService.deleteZcBaseUserReferralByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
package com.ruoyi.baseUser.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* 用户引荐信息对象 zc_base_user_referral
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-16
|
||||
*/
|
||||
public class ZcBaseUserReferral extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id主键 */
|
||||
private Long id;
|
||||
|
||||
/** 被引荐人id */
|
||||
private Long userId;
|
||||
|
||||
@Transient
|
||||
@Excel(name = "被引荐人")
|
||||
private String userName;
|
||||
|
||||
/** 被引荐人手机号 */
|
||||
@Excel(name = "被引荐人手机号")
|
||||
private String userPhoneNumber;
|
||||
|
||||
/** 引荐人id */
|
||||
private Long referralUserId;
|
||||
|
||||
@Transient
|
||||
@Excel(name = "引荐人")
|
||||
private String referralUserName;
|
||||
/** 引荐人手机号 */
|
||||
@Excel(name = "引荐人手机号")
|
||||
private String referralUserPhoneNumber;
|
||||
|
||||
/** 奖励截止日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "奖励截止日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date awardDeadline;
|
||||
|
||||
/** 奖励比例 */
|
||||
@Excel(name = "奖励比例")
|
||||
private BigDecimal awardRate;
|
||||
|
||||
/** 引荐订单 */
|
||||
@Excel(name = "引荐订单")
|
||||
private String referralOrderNo;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setUserPhoneNumber(String userPhoneNumber)
|
||||
{
|
||||
this.userPhoneNumber = userPhoneNumber;
|
||||
}
|
||||
|
||||
public String getReferralUserName() {
|
||||
return referralUserName;
|
||||
}
|
||||
|
||||
public void setReferralUserName(String referralUserName) {
|
||||
this.referralUserName = referralUserName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserPhoneNumber()
|
||||
{
|
||||
return userPhoneNumber;
|
||||
}
|
||||
public void setReferralUserId(Long referralUserId)
|
||||
{
|
||||
this.referralUserId = referralUserId;
|
||||
}
|
||||
|
||||
public Long getReferralUserId()
|
||||
{
|
||||
return referralUserId;
|
||||
}
|
||||
public void setReferralUserPhoneNumber(String referralUserPhoneNumber)
|
||||
{
|
||||
this.referralUserPhoneNumber = referralUserPhoneNumber;
|
||||
}
|
||||
|
||||
public String getReferralUserPhoneNumber()
|
||||
{
|
||||
return referralUserPhoneNumber;
|
||||
}
|
||||
public void setAwardDeadline(Date awardDeadline)
|
||||
{
|
||||
this.awardDeadline = awardDeadline;
|
||||
}
|
||||
|
||||
public Date getAwardDeadline()
|
||||
{
|
||||
return awardDeadline;
|
||||
}
|
||||
public void setAwardRate(BigDecimal awardRate)
|
||||
{
|
||||
this.awardRate = awardRate;
|
||||
}
|
||||
|
||||
public BigDecimal getAwardRate()
|
||||
{
|
||||
return awardRate;
|
||||
}
|
||||
public void setReferralOrderNo(String referralOrderNo)
|
||||
{
|
||||
this.referralOrderNo = referralOrderNo;
|
||||
}
|
||||
|
||||
public String getReferralOrderNo()
|
||||
{
|
||||
return referralOrderNo;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("userPhoneNumber", getUserPhoneNumber())
|
||||
.append("referralUserId", getReferralUserId())
|
||||
.append("referralUserPhoneNumber", getReferralUserPhoneNumber())
|
||||
.append("awardDeadline", getAwardDeadline())
|
||||
.append("awardRate", getAwardRate())
|
||||
.append("referralOrderNo", getReferralOrderNo())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.baseUser.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseUserReferral;
|
||||
|
||||
/**
|
||||
* 用户引荐信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-16
|
||||
*/
|
||||
public interface ZcBaseUserReferralMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户引荐信息
|
||||
*
|
||||
* @param id 用户引荐信息主键
|
||||
* @return 用户引荐信息
|
||||
*/
|
||||
public ZcBaseUserReferral selectZcBaseUserReferralById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户引荐信息列表
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 用户引荐信息集合
|
||||
*/
|
||||
public List<ZcBaseUserReferral> selectZcBaseUserReferralList(ZcBaseUserReferral zcBaseUserReferral);
|
||||
|
||||
/**
|
||||
* 新增用户引荐信息
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcBaseUserReferral(ZcBaseUserReferral zcBaseUserReferral);
|
||||
|
||||
/**
|
||||
* 修改用户引荐信息
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZcBaseUserReferral(ZcBaseUserReferral zcBaseUserReferral);
|
||||
|
||||
/**
|
||||
* 删除用户引荐信息
|
||||
*
|
||||
* @param id 用户引荐信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseUserReferralById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户引荐信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseUserReferralByIds(String[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.baseUser.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseUserReferral;
|
||||
|
||||
/**
|
||||
* 用户引荐信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-16
|
||||
*/
|
||||
public interface IZcBaseUserReferralService
|
||||
{
|
||||
/**
|
||||
* 查询用户引荐信息
|
||||
*
|
||||
* @param id 用户引荐信息主键
|
||||
* @return 用户引荐信息
|
||||
*/
|
||||
public ZcBaseUserReferral selectZcBaseUserReferralById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户引荐信息列表
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 用户引荐信息集合
|
||||
*/
|
||||
public List<ZcBaseUserReferral> selectZcBaseUserReferralList(ZcBaseUserReferral zcBaseUserReferral);
|
||||
|
||||
/**
|
||||
* 新增用户引荐信息
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertZcBaseUserReferral(ZcBaseUserReferral zcBaseUserReferral);
|
||||
|
||||
/**
|
||||
* 修改用户引荐信息
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateZcBaseUserReferral(ZcBaseUserReferral zcBaseUserReferral);
|
||||
|
||||
/**
|
||||
* 批量删除用户引荐信息
|
||||
*
|
||||
* @param ids 需要删除的用户引荐信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseUserReferralByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除用户引荐信息信息
|
||||
*
|
||||
* @param id 用户引荐信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcBaseUserReferralById(Long id);
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.baseUser.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.baseUser.mapper.ZcBaseUserReferralMapper;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseUserReferral;
|
||||
import com.ruoyi.baseUser.service.IZcBaseUserReferralService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 用户引荐信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-08-16
|
||||
*/
|
||||
@Service
|
||||
public class ZcBaseUserReferralServiceImpl implements IZcBaseUserReferralService
|
||||
{
|
||||
@Autowired
|
||||
private ZcBaseUserReferralMapper zcBaseUserReferralMapper;
|
||||
|
||||
/**
|
||||
* 查询用户引荐信息
|
||||
*
|
||||
* @param id 用户引荐信息主键
|
||||
* @return 用户引荐信息
|
||||
*/
|
||||
@Override
|
||||
public ZcBaseUserReferral selectZcBaseUserReferralById(Long id)
|
||||
{
|
||||
return zcBaseUserReferralMapper.selectZcBaseUserReferralById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户引荐信息列表
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 用户引荐信息
|
||||
*/
|
||||
@Override
|
||||
public List<ZcBaseUserReferral> selectZcBaseUserReferralList(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
return zcBaseUserReferralMapper.selectZcBaseUserReferralList(zcBaseUserReferral);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户引荐信息
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertZcBaseUserReferral(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
zcBaseUserReferral.setCreateTime(DateUtils.getNowDate());
|
||||
return zcBaseUserReferralMapper.insertZcBaseUserReferral(zcBaseUserReferral);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户引荐信息
|
||||
*
|
||||
* @param zcBaseUserReferral 用户引荐信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateZcBaseUserReferral(ZcBaseUserReferral zcBaseUserReferral)
|
||||
{
|
||||
zcBaseUserReferral.setUpdateTime(DateUtils.getNowDate());
|
||||
return zcBaseUserReferralMapper.updateZcBaseUserReferral(zcBaseUserReferral);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户引荐信息
|
||||
*
|
||||
* @param ids 需要删除的用户引荐信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZcBaseUserReferralByIds(String ids)
|
||||
{
|
||||
return zcBaseUserReferralMapper.deleteZcBaseUserReferralByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户引荐信息信息
|
||||
*
|
||||
* @param id 用户引荐信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteZcBaseUserReferralById(Long id)
|
||||
{
|
||||
return zcBaseUserReferralMapper.deleteZcBaseUserReferralById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user