feat(mall): 添加佣金修改功能并优化余额和积分修改
- 在 MallMemberMapper.xml 中添加佣金字段查询
- 在 MallMemberVo 中添加佣金属性
- 修改 AdminMallMemberServiceImpl 中的系统支付逻辑,支持佣金修改
- 更新前端模板,增加佣金修改按钮和相关逻辑
- 调整权限控制,统一使用 wallet:update权限
| | |
| | | public enum ScoreFlowTypeEnum { |
| | | |
| | | |
| | | SYSTEM(22,"系统操作{}"), |
| | | WITHDRAWAL(21,"用户余额提现{}"), |
| | | COMMISSION_TO_PRIZE_SCORE(20,"划转{}佣金到积分"), |
| | | COMMISSION_TO_BALANCE(19,"划转{}佣金到余额"), |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("mallSystemPay/{type}/{id}") |
| | | @RequiresPermissions("mallSystemPay:update") |
| | | @RequiresPermissions("wallet:update") |
| | | public String systemPay(@PathVariable long id, @PathVariable Integer type, Model model) { |
| | | MallMemberVo data = mallMemberService.getMallMemberInfoById(id); |
| | | model.addAttribute("systemPay", data); |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.StateUpDownEnum; |
| | | import cc.mrbird.febs.common.enumerates.*; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | |
| | | |
| | | Integer type = mallSystemPayDto.getType(); |
| | | String filedType = ""; |
| | | Integer flowType = 0; |
| | | if (type == 1) { |
| | | filedType = "balance"; |
| | | flowType = FlowTypeEnum.BALANCE.getValue(); |
| | | } else if (type == 2) { |
| | | filedType = "score"; |
| | | } else if (type == 3) { |
| | | filedType = "prizeScore"; |
| | | flowType = FlowTypeEnum.PRIZE_SCORE.getValue(); |
| | | } else if (type == 3) { |
| | | filedType = "commission"; |
| | | flowType = FlowTypeEnum.COMMISSION.getValue(); |
| | | } else { |
| | | throw new FebsException("参数错误"); |
| | | } |
| | |
| | | } else { |
| | | iApiMallMemberWalletService.add(mallSystemPayDto.getAddBalance(), mallSystemPayDto.getId(), filedType); |
| | | } |
| | | mallMoneyFlowService.addMoneyFlow(memberId, bigDecimal, MoneyFlowTypeEnum.SYSTEM.getValue(), null, type); |
| | | mallMoneyFlowService.addMoneyFlow( |
| | | memberId, |
| | | bigDecimal, |
| | | ScoreFlowTypeEnum.SYSTEM.getValue(), |
| | | MallUtils.getOrderNum(), |
| | | flowType, |
| | | StrUtil.format(ScoreFlowTypeEnum.SYSTEM.getDesc(),bigDecimal), |
| | | 2 |
| | | ); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "余额") |
| | | private BigDecimal balance; |
| | | |
| | | @ApiModelProperty(value = "佣金") |
| | | private BigDecimal commission; |
| | | |
| | | @ApiModelProperty(value = "会员等级") |
| | | private String levelName; |
| | | |
| | |
| | | IFNULL(c.balance,0) balance, |
| | | IFNULL(c.score,0) score, |
| | | IFNULL(c.prize_score,0) prizeScore, |
| | | IFNULL(c.commission,0) commission, |
| | | d.description levelName, |
| | | b.name |
| | | FROM mall_member a |
| | |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" lay-event="updateReferer">修改推荐人</button>--> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="updateMemberLevel:update" lay-event="updateMemberLevel">修改会员等级</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="updateSaleLevel:update" lay-event="updateSaleLevel">修改分销等级</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="wallet:update" lay-event="balance">余额修改</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="wallet:update" lay-event="prizeScore">积分修改</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="wallet:update" lay-event="commission">佣金修改</button> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" lay-event="addCoupon">优惠券派送</button>--> |
| | | </div> |
| | | </script> |
| | |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | } |
| | | systemPay("修改余额", checkData[0].id, 1); |
| | | } |
| | | |
| | | if (layEvent === 'score') { |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | } |
| | | systemPay("修改赠送积分", checkData[0].id, 2); |
| | | systemPay("余额", checkData[0].id, 1); |
| | | } |
| | | |
| | | if (layEvent === 'prizeScore') { |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | } |
| | | systemPay("修改竞猜积分", checkData[0].id, 3); |
| | | systemPay("积分", checkData[0].id, 2); |
| | | } |
| | | |
| | | if (layEvent === 'commission') { |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | } |
| | | systemPay("佣金", checkData[0].id, 3); |
| | | } |
| | | |
| | | if (layEvent === 'agentLevel') { |
| | |
| | | if (type == 1) { |
| | | balance = systemPay.balance |
| | | } else if (type == 2) { |
| | | balance = systemPay.score |
| | | } else if (type ==3) { |
| | | balance = systemPay.prizeScore |
| | | } else if (type ==3) { |
| | | balance = systemPay.commission |
| | | } else { |
| | | |
| | | } |