Merge remote-tracking branch 'origin/release-v0.0.1' into release-v0.0.1
This commit is contained in:
commit
e6959f3018
|
|
@ -148,14 +148,17 @@ public class BizMemberController extends BaseController
|
||||||
//取出团队盒数等级配置
|
//取出团队盒数等级配置
|
||||||
List<SysDictData> levels = DictUtils.getDictCache("busi_teamaward_level");
|
List<SysDictData> levels = DictUtils.getDictCache("busi_teamaward_level");
|
||||||
int numLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "1"));
|
int numLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "1"));
|
||||||
|
long teamDou = getTeamDou(teamNum, levels, numLimit);
|
||||||
//归总直属下级盒数
|
//归总直属下级盒数
|
||||||
List<Map> list = (List<Map>) temp.get(memberID);
|
List<Map> list = (List<Map>) temp.get(memberID);
|
||||||
for (Map item : list) {
|
if (list != null) {
|
||||||
Long id = (Long) item.get("id");
|
for (Map item : list) {
|
||||||
long num = ((BigDecimal) item.get("num")).longValue();
|
Long id = (Long) item.get("id");
|
||||||
item.put("totalNum", num);
|
long num = ((BigDecimal) item.get("num")).longValue();
|
||||||
long totalNum = getTeamNum((List<Map>) temp.get(id), item);
|
item.put("totalNum", num);
|
||||||
item.put("desc", getTeamDesc(totalNum, levels, numLimit));
|
getTeamNum((List<Map>) temp.get(id), item);
|
||||||
|
item.put("desc", getTeamDesc((Long) item.get("totalNum"), levels, numLimit, teamDou));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Map resultMap = new HashMap();
|
Map resultMap = new HashMap();
|
||||||
resultMap.put("teamNum", teamNum);
|
resultMap.put("teamNum", teamNum);
|
||||||
|
|
@ -164,9 +167,9 @@ public class BizMemberController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
//取出子级团队盒数
|
//取出子级团队盒数
|
||||||
private long getTeamNum(List<Map> chList, Map parent)
|
private void getTeamNum(List<Map> chList, Map parent)
|
||||||
{
|
{
|
||||||
if (chList == null) return 0;
|
if (chList == null) return;
|
||||||
for (Map item : chList) {
|
for (Map item : chList) {
|
||||||
long num = ((BigDecimal) item.get("num")).longValue();
|
long num = ((BigDecimal) item.get("num")).longValue();
|
||||||
long totalNum = (Long) parent.get("totalNum");
|
long totalNum = (Long) parent.get("totalNum");
|
||||||
|
|
@ -176,13 +179,12 @@ public class BizMemberController extends BaseController
|
||||||
getTeamNum(children, parent);
|
getTeamNum(children, parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (Long) parent.get("totalNum");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//取出团队盒数说明
|
//取得当前团队盒数对应分成
|
||||||
private String getTeamDesc(long totalNum, List<SysDictData> levels, int numLimit)
|
public static long getTeamDou(long totalNum, List<SysDictData> levels, int numLimit)
|
||||||
{
|
{
|
||||||
if (totalNum <= numLimit) return "[团队盒数" + totalNum + " 无分成]";
|
if (totalNum <= numLimit) return 0L;
|
||||||
for (SysDictData data : levels) {
|
for (SysDictData data : levels) {
|
||||||
String label = data.getDictLabel();
|
String label = data.getDictLabel();
|
||||||
long dou = Long.parseLong(data.getDictValue());
|
long dou = Long.parseLong(data.getDictValue());
|
||||||
|
|
@ -190,10 +192,20 @@ public class BizMemberController extends BaseController
|
||||||
long begin = Long.parseLong(split[0]);
|
long begin = Long.parseLong(split[0]);
|
||||||
long end = Long.parseLong(split[1]);
|
long end = Long.parseLong(split[1]);
|
||||||
if (totalNum >= begin && totalNum <= end) {
|
if (totalNum >= begin && totalNum <= end) {
|
||||||
return "[团队盒数" + totalNum + " 分成" + dou + "福豆]";
|
return dou;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
//取出团队盒数说明
|
||||||
|
private String getTeamDesc(long totalNum, List<SysDictData> levels, int numLimit, long teamDou)
|
||||||
|
{
|
||||||
|
long dou = getTeamDou(totalNum, levels, numLimit);
|
||||||
|
if (teamDou == 0) {
|
||||||
|
return "[团队盒数" + totalNum + " 无分成]";
|
||||||
|
}
|
||||||
|
return "[团队盒数" + totalNum + " 分成" + teamDou + "-" + dou + "=" + (teamDou - dou) + "福豆]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
package com.ruoyi.business.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.business.domain.BizTeamReward;
|
||||||
|
import com.ruoyi.business.service.IBizTeamRewardService;
|
||||||
|
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 2020-09-22
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/business/reward")
|
||||||
|
public class BizTeamRewardController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "business/reward";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBizTeamRewardService bizTeamRewardService;
|
||||||
|
|
||||||
|
@RequiresPermissions("business:reward:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String reward()
|
||||||
|
{
|
||||||
|
return prefix + "/reward";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:reward:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BizTeamReward> list = bizTeamRewardService.selectBizTeamRewardList(bizTeamReward);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出团队奖励明细列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:reward:export")
|
||||||
|
@Log(title = "团队奖励明细", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
List<BizTeamReward> list = bizTeamRewardService.selectBizTeamRewardList(bizTeamReward);
|
||||||
|
ExcelUtil<BizTeamReward> util = new ExcelUtil<BizTeamReward>(BizTeamReward.class);
|
||||||
|
return util.exportExcel(list, "reward");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增团队奖励明细
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存团队奖励明细
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:reward:add")
|
||||||
|
@Log(title = "团队奖励明细", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
return toAjax(bizTeamRewardService.insertBizTeamReward(bizTeamReward));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团队奖励明细
|
||||||
|
*/
|
||||||
|
@GetMapping("/edit/{id}")
|
||||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
|
{
|
||||||
|
BizTeamReward bizTeamReward = bizTeamRewardService.selectBizTeamRewardById(id);
|
||||||
|
mmap.put("bizTeamReward", bizTeamReward);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存团队奖励明细
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:reward:edit")
|
||||||
|
@Log(title = "团队奖励明细", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
return toAjax(bizTeamRewardService.updateBizTeamReward(bizTeamReward));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除团队奖励明细
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:reward:remove")
|
||||||
|
@Log(title = "团队奖励明细", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(bizTeamRewardService.deleteBizTeamRewardByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -46,6 +46,9 @@ public class BizMember extends BaseEntity
|
||||||
@Excel(name = "会员类型")
|
@Excel(name = "会员类型")
|
||||||
private Integer memberType;
|
private Integer memberType;
|
||||||
|
|
||||||
|
/** 专项返还等级:0-出局,1-第一次 */
|
||||||
|
private Integer specialLevel;
|
||||||
|
|
||||||
/** 是否删除:0-否,1-是 */
|
/** 是否删除:0-否,1-是 */
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
|
|
||||||
|
|
@ -150,7 +153,16 @@ public class BizMember extends BaseEntity
|
||||||
{
|
{
|
||||||
return memberType;
|
return memberType;
|
||||||
}
|
}
|
||||||
public void setIsDelete(Integer isDelete)
|
|
||||||
|
public Integer getSpecialLevel() {
|
||||||
|
return specialLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecialLevel(Integer specialLevel) {
|
||||||
|
this.specialLevel = specialLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDelete(Integer isDelete)
|
||||||
{
|
{
|
||||||
this.isDelete = isDelete;
|
this.isDelete = isDelete;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,145 @@
|
||||||
|
package com.ruoyi.business.domain;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团队奖励明细对象 biz_team_reward
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-22
|
||||||
|
*/
|
||||||
|
public class BizTeamReward extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
//团队奖励明细类型
|
||||||
|
public static final int TEAM_REWARD_TYPE_RECOMM = 0;
|
||||||
|
public static final int TEAM_REWARD_TYPE_SECOND = 1;
|
||||||
|
public static final int TEAM_REWARD_TYPE_TEAM = 2;
|
||||||
|
|
||||||
|
/** 团队奖励ID */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 会员ID */
|
||||||
|
@Excel(name = "会员ID")
|
||||||
|
private Long memberId;
|
||||||
|
|
||||||
|
/** 团队用户ID */
|
||||||
|
@Excel(name = "团队用户ID")
|
||||||
|
private Long rewardMemberId;
|
||||||
|
|
||||||
|
/** 用户购买产品数量 */
|
||||||
|
@Excel(name = "用户购买产品数量")
|
||||||
|
private Long rewardProductCount;
|
||||||
|
|
||||||
|
/** 奖励的福豆数量 */
|
||||||
|
@Excel(name = "奖励的福豆数量")
|
||||||
|
private Long rewardAmount;
|
||||||
|
|
||||||
|
/** 产品ID */
|
||||||
|
@Excel(name = "产品ID")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/** 奖励类型:0:一级直推;1:二级推荐;2:平级; */
|
||||||
|
@Excel(name = "奖励类型:0:一级直推;1:二级推荐;2:团队;")
|
||||||
|
private Integer rewardType;
|
||||||
|
|
||||||
|
/** 奖励日期(xxxx-xx-xx) */
|
||||||
|
@Excel(name = "奖励日期(xxxx-xx-xx)")
|
||||||
|
private String rewardDate;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setMemberId(Long memberId)
|
||||||
|
{
|
||||||
|
this.memberId = memberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMemberId()
|
||||||
|
{
|
||||||
|
return memberId;
|
||||||
|
}
|
||||||
|
public void setRewardMemberId(Long rewardMemberId)
|
||||||
|
{
|
||||||
|
this.rewardMemberId = rewardMemberId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRewardMemberId()
|
||||||
|
{
|
||||||
|
return rewardMemberId;
|
||||||
|
}
|
||||||
|
public void setRewardProductCount(Long rewardProductCount)
|
||||||
|
{
|
||||||
|
this.rewardProductCount = rewardProductCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRewardProductCount()
|
||||||
|
{
|
||||||
|
return rewardProductCount;
|
||||||
|
}
|
||||||
|
public void setRewardAmount(Long rewardAmount)
|
||||||
|
{
|
||||||
|
this.rewardAmount = rewardAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRewardAmount()
|
||||||
|
{
|
||||||
|
return rewardAmount;
|
||||||
|
}
|
||||||
|
public void setProductId(Long productId)
|
||||||
|
{
|
||||||
|
this.productId = productId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getProductId()
|
||||||
|
{
|
||||||
|
return productId;
|
||||||
|
}
|
||||||
|
public void setRewardType(Integer rewardType)
|
||||||
|
{
|
||||||
|
this.rewardType = rewardType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRewardType()
|
||||||
|
{
|
||||||
|
return rewardType;
|
||||||
|
}
|
||||||
|
public void setRewardDate(String rewardDate)
|
||||||
|
{
|
||||||
|
this.rewardDate = rewardDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRewardDate()
|
||||||
|
{
|
||||||
|
return rewardDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("memberId", getMemberId())
|
||||||
|
.append("rewardMemberId", getRewardMemberId())
|
||||||
|
.append("rewardProductCount", getRewardProductCount())
|
||||||
|
.append("rewardAmount", getRewardAmount())
|
||||||
|
.append("productId", getProductId())
|
||||||
|
.append("rewardType", getRewardType())
|
||||||
|
.append("rewardDate", getRewardDate())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -106,4 +106,45 @@ public interface BizMemberMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public List<Map> selectTeamData(Map paramMap);
|
public List<Map> selectTeamData(Map paramMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询专项划拨任务会员列表
|
||||||
|
*
|
||||||
|
* @param minValue 专项划拨每日金额
|
||||||
|
* @return 会员集合
|
||||||
|
*/
|
||||||
|
public List<BizMember> selectSpecialMember(int minValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取出某用户团队盒数
|
||||||
|
*
|
||||||
|
* @param memberID 上级用户ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public long getMemberTeamCount(Long memberID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员出局等级
|
||||||
|
*
|
||||||
|
* @param bizMember 会员
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateMemberLevel(BizMember bizMember);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询需结算团队分成会员列表
|
||||||
|
*
|
||||||
|
* @param minValue 团队分成最少盒数
|
||||||
|
* @return 会员集合
|
||||||
|
*/
|
||||||
|
public List<Map> selectTeamBenefitMember(int minValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询直接下级会员列表
|
||||||
|
*
|
||||||
|
* @param memberID 会员ID
|
||||||
|
* @return 会员ID集合
|
||||||
|
*/
|
||||||
|
public List<Long> selectSubMember(Long memberID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.business.mapper;
|
package com.ruoyi.business.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.ruoyi.business.domain.BizOrder;
|
import com.ruoyi.business.domain.BizOrder;
|
||||||
import com.ruoyi.business.domain.BizOrderDetail;
|
import com.ruoyi.business.domain.BizOrderDetail;
|
||||||
|
|
||||||
|
|
@ -67,4 +69,12 @@ public interface BizOrderMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertBizOrderDetail(BizOrderDetail bizOrderDetail);
|
public int insertBizOrderDetail(BizOrderDetail bizOrderDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询团队订单
|
||||||
|
*
|
||||||
|
* @param memberID 会员ID
|
||||||
|
* @return 订单集合
|
||||||
|
*/
|
||||||
|
public List<Map> selectTeamBizOrder(Long memberID);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ruoyi.business.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.business.domain.BizTeamReward;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团队奖励明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-22
|
||||||
|
*/
|
||||||
|
public interface BizTeamRewardMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细
|
||||||
|
*
|
||||||
|
* @param id 团队奖励明细ID
|
||||||
|
* @return 团队奖励明细
|
||||||
|
*/
|
||||||
|
public BizTeamReward selectBizTeamRewardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细列表
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 团队奖励明细集合
|
||||||
|
*/
|
||||||
|
public List<BizTeamReward> selectBizTeamRewardList(BizTeamReward bizTeamReward);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增团队奖励明细
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBizTeamReward(BizTeamReward bizTeamReward);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团队奖励明细
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBizTeamReward(BizTeamReward bizTeamReward);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除团队奖励明细
|
||||||
|
*
|
||||||
|
* @param id 团队奖励明细ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizTeamRewardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除团队奖励明细
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizTeamRewardByIds(String[] ids);
|
||||||
|
}
|
||||||
|
|
@ -99,4 +99,20 @@ public interface IBizMemberService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public List<Map> selectTeamData(Map paramMap);
|
public List<Map> selectTeamData(Map paramMap);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行专项划拨每日任务
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int doSpecialTask();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行团队福豆分成每日任务
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int doTeamTask();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.ruoyi.business.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.business.domain.BizTeamReward;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团队奖励明细Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-22
|
||||||
|
*/
|
||||||
|
public interface IBizTeamRewardService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细
|
||||||
|
*
|
||||||
|
* @param id 团队奖励明细ID
|
||||||
|
* @return 团队奖励明细
|
||||||
|
*/
|
||||||
|
public BizTeamReward selectBizTeamRewardById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细列表
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 团队奖励明细集合
|
||||||
|
*/
|
||||||
|
public List<BizTeamReward> selectBizTeamRewardList(BizTeamReward bizTeamReward);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增团队奖励明细
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBizTeamReward(BizTeamReward bizTeamReward);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入团队明细
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void addTeamReward(Long memberID, Long rewardMemberId, Long rewardProductCount, Long rewardAmount, Long productId, int rewardType, String rewardDate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团队奖励明细
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBizTeamReward(BizTeamReward bizTeamReward);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除团队奖励明细
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizTeamRewardByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除团队奖励明细信息
|
||||||
|
*
|
||||||
|
* @param id 团队奖励明细ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBizTeamRewardById(Long id);
|
||||||
|
}
|
||||||
|
|
@ -1,25 +1,31 @@
|
||||||
package com.ruoyi.business.service.impl;
|
package com.ruoyi.business.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.business.controller.BizMemberController;
|
||||||
|
import com.ruoyi.business.domain.BizAccount;
|
||||||
|
import com.ruoyi.business.domain.BizAccountDetail;
|
||||||
|
import com.ruoyi.business.domain.BizMember;
|
||||||
|
import com.ruoyi.business.domain.BizTeamReward;
|
||||||
|
import com.ruoyi.business.mapper.BizAccountMapper;
|
||||||
|
import com.ruoyi.business.mapper.BizMemberMapper;
|
||||||
|
import com.ruoyi.business.mapper.BizOrderMapper;
|
||||||
|
import com.ruoyi.business.service.IBizAccountService;
|
||||||
|
import com.ruoyi.business.service.IBizMemberService;
|
||||||
|
import com.ruoyi.business.service.IBizTeamRewardService;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.system.domain.SysDictData;
|
||||||
|
import com.ruoyi.system.utils.DictUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.ruoyi.business.domain.BizAccount;
|
|
||||||
import com.ruoyi.business.domain.BizAccountDetail;
|
|
||||||
import com.ruoyi.business.mapper.BizAccountMapper;
|
|
||||||
import com.ruoyi.business.service.IBizAccountService;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.ruoyi.business.mapper.BizMemberMapper;
|
|
||||||
import com.ruoyi.business.domain.BizMember;
|
|
||||||
import com.ruoyi.business.service.IBizMemberService;
|
|
||||||
import com.ruoyi.common.core.text.Convert;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员Service业务层处理
|
* 会员Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
@ -32,9 +38,15 @@ public class BizMemberServiceImpl implements IBizMemberService
|
||||||
@Resource
|
@Resource
|
||||||
private BizMemberMapper bizMemberMapper;
|
private BizMemberMapper bizMemberMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
|
private BizOrderMapper bizOrderMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
private IBizAccountService bizAccountService;
|
private IBizAccountService bizAccountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBizTeamRewardService bizTeamRewardService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BizAccountMapper bizAccountMapper;
|
private BizAccountMapper bizAccountMapper;
|
||||||
|
|
||||||
|
|
@ -205,4 +217,157 @@ public class BizMemberServiceImpl implements IBizMemberService
|
||||||
{
|
{
|
||||||
return bizMemberMapper.selectTeamData(paramMap);
|
return bizMemberMapper.selectTeamData(paramMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行专项划拨每日任务
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int doSpecialTask()
|
||||||
|
{
|
||||||
|
//划拨金额
|
||||||
|
int dailyAmount = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "2"));
|
||||||
|
//出局次数
|
||||||
|
int maxLevel = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "5"));
|
||||||
|
//团队盒数标准
|
||||||
|
int teamCountLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "3"));
|
||||||
|
|
||||||
|
List<BizMember> memberList = bizMemberMapper.selectSpecialMember(dailyAmount);
|
||||||
|
int accessCount = 0;
|
||||||
|
for (BizMember member : memberList) {
|
||||||
|
Long memberID = member.getId();
|
||||||
|
Long douSpecial = member.getDouSpecial();
|
||||||
|
//先扣款
|
||||||
|
boolean result = bizAccountService.accountChange(memberID, BizAccount.DOU_SPECIAL, BizAccountDetail.DOU_DETAIL_TYPE_EXCHANGE, (long) -dailyAmount, "", BizAccountDetail.DOU_DESC_SPECIAL2);
|
||||||
|
if (result) {
|
||||||
|
//加入个人账户
|
||||||
|
result = bizAccountService.accountChange(memberID, BizAccount.DOU_PERSON, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, (long) dailyAmount, "", BizAccountDetail.DOU_DESC_SPECIAL2);
|
||||||
|
if (result) {
|
||||||
|
accessCount ++;
|
||||||
|
if (douSpecial <= dailyAmount) {
|
||||||
|
//已经划拨完余额为0,更新用户出局情况
|
||||||
|
long teamCount = bizMemberMapper.getMemberTeamCount(memberID);
|
||||||
|
int specialLevel = member.getSpecialLevel();
|
||||||
|
if (teamCount < teamCountLimit) { //团队盒数不足设定值盒则更新level
|
||||||
|
//达到最大等级则出局
|
||||||
|
specialLevel = specialLevel == maxLevel ? 0 : (specialLevel + 1);
|
||||||
|
member.setSpecialLevel(specialLevel);
|
||||||
|
bizMemberMapper.updateMemberLevel(member);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return accessCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行团队福豆分成每日任务
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public int doTeamTask()
|
||||||
|
{
|
||||||
|
//分成标准
|
||||||
|
List<SysDictData> levels = DictUtils.getDictCache("busi_teamaward_level");
|
||||||
|
//分成盒数限制
|
||||||
|
int numLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "1"));
|
||||||
|
//日期记录上一天的
|
||||||
|
String dateStr = DateUtils.getDate(-1);
|
||||||
|
|
||||||
|
List<Map> memberList = bizMemberMapper.selectTeamBenefitMember(numLimit);
|
||||||
|
int accessCount = 0;
|
||||||
|
for (Map member : memberList) {
|
||||||
|
Long memberID = (Long) member.get("id");
|
||||||
|
Long totalNum = ((BigDecimal) member.get("totalNum")).longValue();
|
||||||
|
long selfDou = BizMemberController.getTeamDou(totalNum, levels, numLimit);
|
||||||
|
|
||||||
|
//存入直接子级的团队盒数和团队成员数据
|
||||||
|
Map<Long, Map> temp = new HashMap();
|
||||||
|
//存入每个子团队用户的结算盒数
|
||||||
|
Map<Long, Integer> numMap = new HashMap();
|
||||||
|
//直接下级列表
|
||||||
|
List<Long> subList = bizMemberMapper.selectSubMember(memberID);
|
||||||
|
for (Long subID : subList) {
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("num", 0);
|
||||||
|
map.put("teamMembers", new ArrayList());
|
||||||
|
temp.put(subID, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Map> orderList = bizOrderMapper.selectTeamBizOrder(memberID);
|
||||||
|
int counter = 0; //剔除前numLimit盒
|
||||||
|
for (Map order : orderList) {
|
||||||
|
Long buyerID = (Long) order.get("id");
|
||||||
|
String allID = (String) order.get("all_id");
|
||||||
|
int count = (Integer) order.get("product_count");
|
||||||
|
for (Long subID : subList) {
|
||||||
|
if (buyerID.equals(subID) || testContains(allID, subID)) { //是自己或子级
|
||||||
|
Map subMap = temp.get(subID);
|
||||||
|
int num = (Integer) subMap.get("num");
|
||||||
|
subMap.put("num", num + count);
|
||||||
|
List chList = (List) subMap.get("teamMembers");
|
||||||
|
if (!chList.contains(buyerID)) {
|
||||||
|
chList.add(buyerID);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//筛选出没到限制盒数的无效订单
|
||||||
|
int oldCount = counter;
|
||||||
|
counter += count;
|
||||||
|
if (counter <= numLimit) continue;
|
||||||
|
if (oldCount <= numLimit) {
|
||||||
|
//有可能一个订单同时包含有效盒和无效盒
|
||||||
|
count = counter - numLimit;
|
||||||
|
}
|
||||||
|
//存入每个团队成员的明细
|
||||||
|
Integer chTotal = (Integer) numMap.get(buyerID);
|
||||||
|
if (chTotal == null) chTotal = 0;
|
||||||
|
chTotal += count;
|
||||||
|
numMap.put(buyerID, chTotal);
|
||||||
|
}
|
||||||
|
//根据直接下级计算数据
|
||||||
|
long totalBenefit = 0L;
|
||||||
|
for (Long subID : subList) {
|
||||||
|
Map subMap = temp.get(subID);
|
||||||
|
int subTeamNum = (Integer) subMap.get("num");
|
||||||
|
//比较subDou和selfDou得出子团队分成数值
|
||||||
|
long subDou = BizMemberController.getTeamDou(subTeamNum, levels, numLimit);
|
||||||
|
long getDou = selfDou - subDou;
|
||||||
|
if (getDou <= 0) continue;
|
||||||
|
//子团队用户列表取出
|
||||||
|
List<Long> chList = (List<Long>) subMap.get("teamMembers");
|
||||||
|
//每个子级用户添加teamAward数据
|
||||||
|
for (Long chID : chList) {
|
||||||
|
//子级盒数
|
||||||
|
Integer chTotal = numMap.get(chID);
|
||||||
|
if (chTotal == null || chTotal <= 0) continue;
|
||||||
|
long benefit = getDou * chTotal; //该子用户分成
|
||||||
|
//插入数据
|
||||||
|
bizTeamRewardService.addTeamReward(memberID, chID, (long) chTotal, benefit, null, BizTeamReward.TEAM_REWARD_TYPE_TEAM, dateStr);
|
||||||
|
totalBenefit += benefit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//团队福豆及福豆田
|
||||||
|
if (totalBenefit > 0) {
|
||||||
|
accessCount ++;
|
||||||
|
bizAccountService.accountChange(memberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, totalBenefit,"", BizAccountDetail.DOU_DESC_TEAM);
|
||||||
|
bizAccountService.accountChange(memberID, BizAccount.DOU_FIELD, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, totalBenefit,"", BizAccountDetail.DOU_DESC_TEAM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return accessCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
//测试all包含字符串
|
||||||
|
private boolean testContains(String allID, Long id)
|
||||||
|
{
|
||||||
|
return ("," + allID + ",").indexOf("," + id + ",") >= 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@ public class BizOrderServiceImpl implements IBizOrderService
|
||||||
@Resource
|
@Resource
|
||||||
private BizAccountServiceImpl bizAccountService;
|
private BizAccountServiceImpl bizAccountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BizTeamRewardServiceImpl bizTeamRewardService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询订单
|
* 查询订单
|
||||||
*
|
*
|
||||||
|
|
@ -171,8 +174,17 @@ public class BizOrderServiceImpl implements IBizOrderService
|
||||||
if (douBalance < orderTotal.longValue()) {
|
if (douBalance < orderTotal.longValue()) {
|
||||||
return AjaxResult.error("福豆余额不足");
|
return AjaxResult.error("福豆余额不足");
|
||||||
}
|
}
|
||||||
BigDecimal cashbackAmount = product.getCashbackAmount().multiply(new BigDecimal(productNum));
|
//判断专项划拨相关金额
|
||||||
//TODO cashbackAmount 专项划拨金额等级判断
|
int decreaseAmount = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "4"));
|
||||||
|
BigDecimal cashbackAmount = product.getCashbackAmount();
|
||||||
|
boolean isTeam = cashbackAmount.longValue() > 0;
|
||||||
|
Integer specialLevel = member.getSpecialLevel();
|
||||||
|
BigDecimal cashbackTotalAmount = new BigDecimal(0);
|
||||||
|
if (specialLevel != null && specialLevel > 0) { //未出局
|
||||||
|
//重新计算专项金额
|
||||||
|
cashbackAmount = cashbackAmount.add(new BigDecimal((specialLevel - 1) * decreaseAmount));
|
||||||
|
cashbackTotalAmount = cashbackAmount.multiply(new BigDecimal(productNum));
|
||||||
|
}
|
||||||
|
|
||||||
//判断地址
|
//判断地址
|
||||||
BizMemberAddress address = bizMemberAddressMapper.selectBizMemberAddressById(addressID);
|
BizMemberAddress address = bizMemberAddressMapper.selectBizMemberAddressById(addressID);
|
||||||
|
|
@ -188,7 +200,7 @@ public class BizOrderServiceImpl implements IBizOrderService
|
||||||
order.setMemberName(member.getMemberName());
|
order.setMemberName(member.getMemberName());
|
||||||
order.setOrderAmount(orderTotal);
|
order.setOrderAmount(orderTotal);
|
||||||
order.setOrderStatus(BizOrder.STATUS_PAYED); //已支付
|
order.setOrderStatus(BizOrder.STATUS_PAYED); //已支付
|
||||||
order.setIsTeam(cashbackAmount.longValue() > 0 ? 1 : 0); //是否团队福豆影响订单
|
order.setIsTeam(isTeam ? 1 : 0); //是否团队福豆影响订单
|
||||||
order.setRemark(remark);
|
order.setRemark(remark);
|
||||||
order.setAddressDetail(address.getAddress());
|
order.setAddressDetail(address.getAddress());
|
||||||
order.setAddressId(addressID);
|
order.setAddressId(addressID);
|
||||||
|
|
@ -205,38 +217,43 @@ public class BizOrderServiceImpl implements IBizOrderService
|
||||||
|
|
||||||
String businessCode = String.valueOf(order.getOrderSn());
|
String businessCode = String.valueOf(order.getOrderSn());
|
||||||
//减去福豆余额账户
|
//减去福豆余额账户
|
||||||
// TODO 类型不对,同步完数据后在修改
|
|
||||||
boolean result = bizAccountService.accountChange(memberID, BizAccount.DOU_BALANCE, BizAccountDetail.DOU_DETAIL_TYPE_ORDER, -orderTotal.longValue(), businessCode, BizAccountDetail.DOU_DESC_ORDER);
|
boolean result = bizAccountService.accountChange(memberID, BizAccount.DOU_BALANCE, BizAccountDetail.DOU_DETAIL_TYPE_ORDER, -orderTotal.longValue(), businessCode, BizAccountDetail.DOU_DESC_ORDER);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return AjaxResult.error("扣款失败,请联系管理员");
|
return AjaxResult.error("扣款失败,请联系管理员");
|
||||||
}
|
}
|
||||||
//增加专项账户
|
//增加专项账户
|
||||||
if(cashbackAmount.longValue() > 0) {
|
if(isTeam) {
|
||||||
// TODO 类型不对,同步完数据后在修改
|
if (cashbackTotalAmount.longValue() > 0) {
|
||||||
result = bizAccountService.accountChange(memberID, BizAccount.DOU_SPECIAL, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, cashbackAmount.longValue(), businessCode, BizAccountDetail.DOU_DESC_SPECIAL1);
|
result = bizAccountService.accountChange(memberID, BizAccount.DOU_SPECIAL, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, cashbackTotalAmount.longValue(), businessCode, BizAccountDetail.DOU_DESC_SPECIAL1);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return AjaxResult.error("扣款失败,请联系管理员");
|
return AjaxResult.error("扣款失败,请联系管理员");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//增加直推奖励(团队福豆账户)
|
//增加直推奖励(团队福豆账户)
|
||||||
Long recMemberID = member.getRecommendId();
|
Long recMemberID = member.getRecommendId();
|
||||||
if (recMemberID != null && recMemberID != 0) {
|
if (recMemberID != null && recMemberID != 0) {
|
||||||
//取出直推奖励金额
|
//取出直推奖励金额
|
||||||
String award1 = DictUtils.getDictLabel("busi_recommend_award", "1");
|
long award1 = productNum * Long.parseLong(DictUtils.getDictLabel("busi_recommend_award", "1"));
|
||||||
result = bizAccountService.accountChange(memberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, Long.parseLong(award1), businessCode, BizAccountDetail.DOU_DESC_RECOMM);
|
result = bizAccountService.accountChange(recMemberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, award1, businessCode, BizAccountDetail.DOU_DESC_RECOMM);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return AjaxResult.error("扣款失败,请联系管理员");
|
return AjaxResult.error("扣款失败,请联系管理员");
|
||||||
}
|
}
|
||||||
|
//增加团队积分数据(直推)
|
||||||
|
String dateStr = DateUtils.getDate(-1); //日期记录上一天的
|
||||||
|
bizTeamRewardService.addTeamReward(recMemberID, memberID, (long) productNum, award1, productID, BizTeamReward.TEAM_REWARD_TYPE_RECOMM, dateStr);
|
||||||
//判断二级直推(需要3个下级)
|
//判断二级直推(需要3个下级)
|
||||||
BizMember recommendMember = bizMemberMapper.selectBizMemberSimple(recMemberID);
|
BizMember recommendMember = bizMemberMapper.selectBizMemberSimple(recMemberID);
|
||||||
Long topMemberID = recommendMember.getRecommendId();
|
Long topMemberID = recommendMember.getRecommendId();
|
||||||
//判断有效下级数不少于三个
|
//判断有效下级数不少于三个
|
||||||
if (bizMemberMapper.getValidChildCount(topMemberID) >= BizAccount.SECOND_AWARD_CHILD_LIMIT) {
|
if (recMemberID != null && bizMemberMapper.getValidChildCount(topMemberID) >= BizAccount.SECOND_AWARD_CHILD_LIMIT) {
|
||||||
String award2 = DictUtils.getDictLabel("busi_recommend_award", "2");
|
long award2 = productNum * Long.parseLong(DictUtils.getDictLabel("busi_recommend_award", "2"));
|
||||||
result = bizAccountService.accountChange(memberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, Long.parseLong(award2), businessCode, BizAccountDetail.DOU_DESC_SECOND);
|
result = bizAccountService.accountChange(topMemberID, BizAccount.DOU_TEAM, BizAccountDetail.DOU_DETAIL_TYPE_CHARGE, award2, businessCode, BizAccountDetail.DOU_DESC_SECOND);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return AjaxResult.error("扣款失败,请联系管理员");
|
return AjaxResult.error("扣款失败,请联系管理员");
|
||||||
}
|
}
|
||||||
|
//增加团队积分数据(二推)
|
||||||
|
bizTeamRewardService.addTeamReward(topMemberID, memberID, (long) productNum, award2, productID, BizTeamReward.TEAM_REWARD_TYPE_SECOND, dateStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.ruoyi.business.service.impl;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
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.business.mapper.BizTeamRewardMapper;
|
||||||
|
import com.ruoyi.business.domain.BizTeamReward;
|
||||||
|
import com.ruoyi.business.service.IBizTeamRewardService;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团队奖励明细Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2020-09-22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BizTeamRewardServiceImpl implements IBizTeamRewardService
|
||||||
|
{
|
||||||
|
@Resource
|
||||||
|
private BizTeamRewardMapper bizTeamRewardMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细
|
||||||
|
*
|
||||||
|
* @param id 团队奖励明细ID
|
||||||
|
* @return 团队奖励明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BizTeamReward selectBizTeamRewardById(Long id)
|
||||||
|
{
|
||||||
|
return bizTeamRewardMapper.selectBizTeamRewardById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询团队奖励明细列表
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 团队奖励明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BizTeamReward> selectBizTeamRewardList(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
return bizTeamRewardMapper.selectBizTeamRewardList(bizTeamReward);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增团队奖励明细
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBizTeamReward(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
bizTeamReward.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return bizTeamRewardMapper.insertBizTeamReward(bizTeamReward);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入团队明细
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addTeamReward(Long memberID, Long rewardMemberId, Long rewardProductCount, Long rewardAmount, Long productId, int rewardType, String rewardDate)
|
||||||
|
{
|
||||||
|
BizTeamReward bizTeamReward = new BizTeamReward();
|
||||||
|
bizTeamReward.setMemberId(memberID);
|
||||||
|
bizTeamReward.setRewardMemberId(rewardMemberId);
|
||||||
|
bizTeamReward.setRewardProductCount(rewardProductCount);
|
||||||
|
bizTeamReward.setRewardAmount(rewardAmount);
|
||||||
|
bizTeamReward.setProductId(productId);
|
||||||
|
bizTeamReward.setRewardType(rewardType);
|
||||||
|
bizTeamReward.setRewardDate(rewardDate);
|
||||||
|
bizTeamReward.setCreateTime(new Date());
|
||||||
|
insertBizTeamReward(bizTeamReward);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团队奖励明细
|
||||||
|
*
|
||||||
|
* @param bizTeamReward 团队奖励明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBizTeamReward(BizTeamReward bizTeamReward)
|
||||||
|
{
|
||||||
|
bizTeamReward.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return bizTeamRewardMapper.updateBizTeamReward(bizTeamReward);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除团队奖励明细对象
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBizTeamRewardByIds(String ids)
|
||||||
|
{
|
||||||
|
return bizTeamRewardMapper.deleteBizTeamRewardByIds(Convert.toStrArray(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除团队奖励明细信息
|
||||||
|
*
|
||||||
|
* @param id 团队奖励明细ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBizTeamRewardById(Long id)
|
||||||
|
{
|
||||||
|
return bizTeamRewardMapper.deleteBizTeamRewardById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ public class BusinessTask {
|
||||||
LogUtils.getAccessLog().info("======今日非休息日,开始执行福豆相关任务======");
|
LogUtils.getAccessLog().info("======今日非休息日,开始执行福豆相关任务======");
|
||||||
|
|
||||||
//专项划拨任务
|
//专项划拨任务
|
||||||
doSpecialTask();
|
//doSpecialTask();
|
||||||
|
|
||||||
//团队福豆分成任务
|
//团队福豆分成任务
|
||||||
doTeamTask();
|
doTeamTask();
|
||||||
|
|
@ -67,10 +67,9 @@ public class BusinessTask {
|
||||||
private void doSpecialTask()
|
private void doSpecialTask()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
int dailyAmount = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "2"));
|
int accessCount = bizMemberService.doSpecialTask();
|
||||||
|
|
||||||
|
LogUtils.getAccessLog().info("======执行专项划拨任务完成,处理会员数据" + accessCount + "条======");
|
||||||
LogUtils.getAccessLog().info("======执行专项划拨任务完成======");
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
LogUtils.getAccessLog().error("======执行专项划拨任务出错======" + ex.getMessage());
|
LogUtils.getAccessLog().error("======执行专项划拨任务出错======" + ex.getMessage());
|
||||||
|
|
@ -81,10 +80,9 @@ public class BusinessTask {
|
||||||
private void doTeamTask()
|
private void doTeamTask()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
int numLimit = Integer.parseInt(DictUtils.getDictLabel("busi_award_set", "1"));
|
int accessCount = bizMemberService.doTeamTask();
|
||||||
|
|
||||||
|
LogUtils.getAccessLog().info("======执行团队福豆分成任务完成,处理会员数据" + accessCount + "条======");
|
||||||
LogUtils.getAccessLog().info("======执行团队福豆分成任务完成======");
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
LogUtils.getAccessLog().error("======执行团队福豆分成任务出错======" + ex.getMessage());
|
LogUtils.getAccessLog().error("======执行团队福豆分成任务出错======" + ex.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="recommendMobile" column="recommend_mobile" />
|
<result property="recommendMobile" column="recommend_mobile" />
|
||||||
<result property="recommendName" column="recommend_name" />
|
<result property="recommendName" column="recommend_name" />
|
||||||
<result property="memberType" column="member_type" />
|
<result property="memberType" column="member_type" />
|
||||||
|
<result property="specialLevel" column="special_level" />
|
||||||
<result property="isDelete" column="is_delete" />
|
<result property="isDelete" column="is_delete" />
|
||||||
<result property="isEnable" column="is_enable" />
|
<result property="isEnable" column="is_enable" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
|
|
@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBizMemberVo">
|
<sql id="selectBizMemberVo">
|
||||||
select a.id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, is_delete, is_enable, create_by, create_time, update_by, update_time,
|
select a.id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, special_level, is_delete, is_enable, create_by, create_time, update_by, update_time,
|
||||||
(select amount from biz_account where member_id = a.id and account_type = 0) douBalance,
|
(select amount from biz_account where member_id = a.id and account_type = 0) douBalance,
|
||||||
(select amount from biz_account where member_id = a.id and account_type = 1) douPerson,
|
(select amount from biz_account where member_id = a.id and account_type = 1) douPerson,
|
||||||
(select amount from biz_account where member_id = a.id and account_type = 2) douTeam,
|
(select amount from biz_account where member_id = a.id and account_type = 2) douTeam,
|
||||||
|
|
@ -59,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBizMemberSimple" parameterType="Long" resultMap="BizMemberResult">
|
<select id="selectBizMemberSimple" parameterType="Long" resultMap="BizMemberResult">
|
||||||
select id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, is_delete, is_enable, create_by, create_time, update_by, update_time
|
select id, mobile, member_name, password, recommend_id, recommend_mobile, recommend_name, member_type, special_level, is_delete, is_enable, create_by, create_time, update_by, update_time
|
||||||
from biz_member where id = #{id}
|
from biz_member where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -150,4 +151,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
group by a.id,a.member_name,a.recommend_id
|
group by a.id,a.member_name,a.recommend_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSpecialMember" parameterType="Integer" resultMap="BizMemberResult">
|
||||||
|
select a.id, special_level, b.amount douSpecial from biz_member a
|
||||||
|
left join biz_account b on a.id = b.member_id and b.account_type = 3
|
||||||
|
where is_delete = 0 and b.amount >= #{minValue}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getMemberTeamCount" parameterType="Long" resultType="Long">
|
||||||
|
select IF(sum(num) IS NULL,0,sum(num)) totalNum from (
|
||||||
|
select a.id, sum(IF(c.product_count IS NULL,0,c.product_count)) as num from biz_member a
|
||||||
|
left join biz_order b on a.id = b.member_id and b.order_status > 0 and b.is_team = 1
|
||||||
|
left join biz_order_detail c on c.order_id = b.id
|
||||||
|
where concat(',', recommend_all_id, ',') like concat('%,', #{memberID}, ',%')
|
||||||
|
group by a.id
|
||||||
|
) t
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateMemberLevel" parameterType="BizMember">
|
||||||
|
update biz_member
|
||||||
|
set special_level = #{specialLevel}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectTeamBenefitMember" parameterType="Integer" resultType="Map">
|
||||||
|
select id, totalNum from (
|
||||||
|
select t1.id, IF(sum(num) IS NULL,0,sum(num)) totalNum from (
|
||||||
|
select distinct(m1.id) from biz_member m1
|
||||||
|
inner join biz_order o1 on m1.id = o1.member_id and o1.order_status > 0 and o1.is_team = 1
|
||||||
|
where m1.is_delete = 0 and (select count(id) from biz_member m2 where m2.recommend_id=m1.id) >= 3
|
||||||
|
) t1
|
||||||
|
inner join
|
||||||
|
(
|
||||||
|
select a.id, a.recommend_all_id, sum(IF(c.product_count IS NULL,0,c.product_count)) as num from biz_member a
|
||||||
|
left join biz_order b on a.id = b.member_id and b.order_status > 0 and b.is_team = 1
|
||||||
|
left join biz_order_detail c on c.order_id = b.id
|
||||||
|
where a.is_delete = 0
|
||||||
|
group by a.id
|
||||||
|
) t2 on concat(',', t2.recommend_all_id, ',') like concat('%', t1.id, '%') and t2.num > 0
|
||||||
|
group by t1.id
|
||||||
|
) t3
|
||||||
|
where totalNum > #{minValue}
|
||||||
|
order by id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSubMember" parameterType="Long" resultType="Long">
|
||||||
|
select id from biz_member where recommend_id = #{memberID}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -156,4 +156,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectTeamBizOrder" parameterType="Long" resultType="Map">
|
||||||
|
select b.id, b.recommend_all_id all_id, c.product_count from biz_order a
|
||||||
|
left join biz_member b on a.member_id = b.id
|
||||||
|
left join (select max(id), order_id, product_id, product_count from biz_order_detail group by order_id) c on a.id = c.order_id
|
||||||
|
where a.order_status > 0 and a.is_team = 1 and concat(',', b.recommend_all_id, ',') like concat('%', #{memberID}, '%')
|
||||||
|
order by a.id asc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
<?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.ruoyi.business.mapper.BizTeamRewardMapper">
|
||||||
|
|
||||||
|
<resultMap type="BizTeamReward" id="BizTeamRewardResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="memberId" column="member_id" />
|
||||||
|
<result property="rewardMemberId" column="reward_member_id" />
|
||||||
|
<result property="rewardProductCount" column="reward_product_count" />
|
||||||
|
<result property="rewardAmount" column="reward_amount" />
|
||||||
|
<result property="productId" column="product_id" />
|
||||||
|
<result property="rewardType" column="reward_type" />
|
||||||
|
<result property="rewardDate" column="reward_date" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBizTeamRewardVo">
|
||||||
|
select id, member_id, reward_member_id, reward_product_count, reward_amount, product_id, reward_type, reward_date, create_by, create_time, update_by, update_time from biz_team_reward
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBizTeamRewardList" parameterType="BizTeamReward" resultMap="BizTeamRewardResult">
|
||||||
|
<include refid="selectBizTeamRewardVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||||
|
<if test="rewardMemberId != null "> and reward_member_id = #{rewardMemberId}</if>
|
||||||
|
<if test="rewardProductCount != null "> and reward_product_count = #{rewardProductCount}</if>
|
||||||
|
<if test="rewardAmount != null "> and reward_amount = #{rewardAmount}</if>
|
||||||
|
<if test="productId != null "> and product_id = #{productId}</if>
|
||||||
|
<if test="rewardType != null "> and reward_type = #{rewardType}</if>
|
||||||
|
<if test="rewardDate != null and rewardDate != ''"> and reward_date = #{rewardDate}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBizTeamRewardById" parameterType="Long" resultMap="BizTeamRewardResult">
|
||||||
|
<include refid="selectBizTeamRewardVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBizTeamReward" parameterType="BizTeamReward" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into biz_team_reward
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="memberId != null">member_id,</if>
|
||||||
|
<if test="rewardMemberId != null">reward_member_id,</if>
|
||||||
|
<if test="rewardProductCount != null">reward_product_count,</if>
|
||||||
|
<if test="rewardAmount != null">reward_amount,</if>
|
||||||
|
<if test="productId != null">product_id,</if>
|
||||||
|
<if test="rewardType != null">reward_type,</if>
|
||||||
|
<if test="rewardDate != null and rewardDate != ''">reward_date,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="memberId != null">#{memberId},</if>
|
||||||
|
<if test="rewardMemberId != null">#{rewardMemberId},</if>
|
||||||
|
<if test="rewardProductCount != null">#{rewardProductCount},</if>
|
||||||
|
<if test="rewardAmount != null">#{rewardAmount},</if>
|
||||||
|
<if test="productId != null">#{productId},</if>
|
||||||
|
<if test="rewardType != null">#{rewardType},</if>
|
||||||
|
<if test="rewardDate != null and rewardDate != ''">#{rewardDate},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBizTeamReward" parameterType="BizTeamReward">
|
||||||
|
update biz_team_reward
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="memberId != null">member_id = #{memberId},</if>
|
||||||
|
<if test="rewardMemberId != null">reward_member_id = #{rewardMemberId},</if>
|
||||||
|
<if test="rewardProductCount != null">reward_product_count = #{rewardProductCount},</if>
|
||||||
|
<if test="rewardAmount != null">reward_amount = #{rewardAmount},</if>
|
||||||
|
<if test="productId != null">product_id = #{productId},</if>
|
||||||
|
<if test="rewardType != null">reward_type = #{rewardType},</if>
|
||||||
|
<if test="rewardDate != null and rewardDate != ''">reward_date = #{rewardDate},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBizTeamRewardById" parameterType="Long">
|
||||||
|
delete from biz_team_reward where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBizTeamRewardByIds" parameterType="String">
|
||||||
|
delete from biz_team_reward where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -29,7 +29,8 @@
|
||||||
.childDiv{padding:7px 0 0 0}
|
.childDiv{padding:7px 0 0 0}
|
||||||
.childDiv .cont{padding-left: 20px}
|
.childDiv .cont{padding-left: 20px}
|
||||||
.childDiv span{display:block;font-size: 14px;line-height: 24px;padding:0 0 4px 4px;cursor:pointer;border-radius: 5px;border:1px solid #AAAAAA}
|
.childDiv span{display:block;font-size: 14px;line-height: 24px;padding:0 0 4px 4px;cursor:pointer;border-radius: 5px;border:1px solid #AAAAAA}
|
||||||
.childDiv span.noneChild{padding-left: 29px;padding-top: 2px;padding-bottom: 2px}
|
.childDiv span.noneChild{padding-left: 19px;padding-top: 2px;padding-bottom: 2px}
|
||||||
|
.childDiv span ss{font-family: 宋体}
|
||||||
</style>
|
</style>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var prefix = ctx + "business/member";
|
var prefix = ctx + "business/member";
|
||||||
|
|
@ -44,7 +45,12 @@
|
||||||
$.post(prefix + "/accountTeamDetail", "memberID=" + $("#memberID").val() + "&productID=" + productID, function(resp){
|
$.post(prefix + "/accountTeamDetail", "memberID=" + $("#memberID").val() + "&productID=" + productID, function(resp){
|
||||||
if(resp.code != 0) return;
|
if(resp.code != 0) return;
|
||||||
$("#numSpan").text(resp.data.teamNum);
|
$("#numSpan").text(resp.data.teamNum);
|
||||||
showChildren($("#container"), resp.data.memberList, true);
|
let members = resp.data.memberList;
|
||||||
|
if(!members){
|
||||||
|
$("#container").html(" 该用户没有子级");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showChildren($("#container"), members, true);
|
||||||
$("#container .cont").hide();
|
$("#container .cont").hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -55,7 +61,7 @@
|
||||||
let item = list[i];
|
let item = list[i];
|
||||||
let children = item.children;
|
let children = item.children;
|
||||||
let child = clone.clone().show();
|
let child = clone.clone().show();
|
||||||
child.html("<span class='" + (children ? "glyphicon glyphicon-chevron-right" : "noneChild") + "'> " + item.member_name + item.mobile + "(" + item.num + "盒) <b style='color:#0000FF'>" + (flag ? item.desc : "") + "</b></span>");
|
child.html("<span class='" + (children ? "glyphicon glyphicon-chevron-right" : "noneChild") + "'><ss> " + item.member_name + item.mobile + "(" + item.num + "盒) <b style='color:#0000FF'>" + (flag ? item.desc : "") + "</b></ss></span>");
|
||||||
div.append(child);
|
div.append(child);
|
||||||
if(children){
|
if(children){
|
||||||
child.append("<div class='cont'></div>");
|
child.append("<div class='cont'></div>");
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.common.utils;
|
||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
|
|
||||||
|
|
@ -50,6 +51,18 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||||
return dateTimeNow(YYYY_MM_DD);
|
return dateTimeNow(YYYY_MM_DD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前日期偏差日期, 默认格式为yyyy-MM-dd
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static String getDate(int diff)
|
||||||
|
{
|
||||||
|
Calendar now = Calendar.getInstance();
|
||||||
|
now.add(Calendar.DAY_OF_MONTH, diff);
|
||||||
|
return dateTime(now.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
public static final String getTime()
|
public static final String getTime()
|
||||||
{
|
{
|
||||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ CREATE TABLE `biz_member` (
|
||||||
`recommend_mobile` varchar(32) NOT NULL DEFAULT '' COMMENT '推荐人手机',
|
`recommend_mobile` varchar(32) NOT NULL DEFAULT '' COMMENT '推荐人手机',
|
||||||
`recommend_name` varchar(32) NOT NULL DEFAULT '' COMMENT '推荐人姓名',
|
`recommend_name` varchar(32) NOT NULL DEFAULT '' COMMENT '推荐人姓名',
|
||||||
`member_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '会员类型',
|
`member_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '会员类型',
|
||||||
|
`special_level` tinyint(1) NOT NULL DEFAULT 1 COMMENT '专项返还次数(默认1, 若出局为0)',
|
||||||
`is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除:0-否,1-是',
|
`is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除:0-否,1-是',
|
||||||
`is_enable` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否禁用:0-否,1-是',
|
`is_enable` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否禁用:0-否,1-是',
|
||||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
|
|
@ -75,9 +76,9 @@ CREATE TABLE `biz_team_reward` (
|
||||||
`reward_member_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '团队用户ID',
|
`reward_member_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '团队用户ID',
|
||||||
`reward_product_count` int(11) NOT NULL DEFAULT 0 COMMENT '用户购买产品数量',
|
`reward_product_count` int(11) NOT NULL DEFAULT 0 COMMENT '用户购买产品数量',
|
||||||
`reward_amount` decimal(12,2) NOT NULL DEFAULT 0.0 COMMENT '奖励的福豆数量',
|
`reward_amount` decimal(12,2) NOT NULL DEFAULT 0.0 COMMENT '奖励的福豆数量',
|
||||||
`product_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '产品ID',
|
`product_id` bigint(20) DEFAULT 0 COMMENT '产品ID',
|
||||||
`reward_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '奖励类型:0:一级直推;1:二级推荐;2:平级;',
|
`reward_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '奖励类型:0:一级直推;1:二级推荐;2:平级;',
|
||||||
`reward_date` datetime DEFAULT NULL COMMENT '奖励时间',
|
`reward_date` varchar(10) DEFAULT NULL COMMENT '奖励日期',
|
||||||
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
|
||||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue