43 files modified
25 files added
| | |
| | | return new RabbitTemplate(connectionFactory); |
| | | } |
| | | |
| | | @Bean |
| | | public DirectExchange defaultExchange() { |
| | | return new DirectExchange(ExchangeConstants.EXCHANGE_DEFAULT); |
| | | } |
| | | |
| | | // === 延时 start === |
| | | @Bean |
| | | public Queue defaultQueue() { |
| | | return new Queue(QueueConstants.QUEUE_DEFAULT); |
| | | public DirectExchange delayExchangeTtl() { |
| | | return new DirectExchange(RabbitQueueEnum.CHOU_JIANG_TIME_TTL.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding defaultBind() { |
| | | return BindingBuilder.bind(defaultQueue()).to(defaultExchange()).with(RouteKeyConstants.ROUTE_KEY_DEFAULT); |
| | | } |
| | | |
| | | @Bean |
| | | public DirectExchange delayTtlExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.ORDER_CANCEL_DELAY_TTL.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public DirectExchange orderDelayExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.ORDER_CANCEL_DELAY.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue orderDelayQueue() { |
| | | return new Queue(RabbitQueueEnum.ORDER_CANCEL_DELAY.getQueue()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue orderDelayQueueTtl() { |
| | | return QueueBuilder.durable(RabbitQueueEnum.ORDER_CANCEL_DELAY_TTL.getQueue()) |
| | | //到期后转发的交换机 |
| | | .withArgument("x-dead-letter-exchange", RabbitQueueEnum.ORDER_CANCEL_DELAY.getExchange()) |
| | | //到期后转发的路由键 |
| | | .withArgument("x-dead-letter-routing-key", RabbitQueueEnum.ORDER_CANCEL_DELAY.getRoute()) |
| | | .build(); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding orderDelayBind() { |
| | | return BindingBuilder.bind(orderDelayQueue()).to(orderDelayExchange()).with(RabbitQueueEnum.ORDER_CANCEL_DELAY.getRoute()); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding orderDelayBindTtl() { |
| | | return BindingBuilder.bind(orderDelayQueueTtl()).to(delayTtlExchange()).with(RabbitQueueEnum.ORDER_CANCEL_DELAY_TTL.getRoute()); |
| | | return BindingBuilder.bind(orderDelayQueueTtl()).to(delayExchangeTtl()).with(RabbitQueueEnum.CHOU_JIANG_TIME_TTL.getRoute()); |
| | | } |
| | | @Bean |
| | | public Queue orderDelayQueueTtl() { |
| | | return QueueBuilder.durable(RabbitQueueEnum.CHOU_JIANG_TIME_TTL.getQueue()) |
| | | //到期后转发的交换机 |
| | | .withArgument("x-dead-letter-exchange", RabbitQueueEnum.CHOU_JIANG_TIME.getExchange()) |
| | | //到期后转发的路由键 |
| | | .withArgument("x-dead-letter-routing-key", RabbitQueueEnum.CHOU_JIANG_TIME.getRoute()) |
| | | .build(); |
| | | } |
| | | @Bean |
| | | public DirectExchange orderDelayExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.CHOU_JIANG_TIME.getExchange()); |
| | | } |
| | | @Bean |
| | | public Queue orderDelayQueue() { |
| | | return new Queue(RabbitQueueEnum.CHOU_JIANG_TIME.getQueue()); |
| | | } |
| | | @Bean |
| | | public Binding orderDelayBind() { |
| | | return BindingBuilder.bind(orderDelayQueue()).to(orderDelayExchange()).with(RabbitQueueEnum.CHOU_JIANG_TIME.getRoute()); |
| | | } |
| | | // === 延时 end === |
| | | |
| | | |
| | | // === 延时 start === |
| | | @Bean |
| | | public DirectExchange delayExchangeTtlNoTime() { |
| | | return new DirectExchange(RabbitQueueEnum.NO_TIME_TTL.getExchange()); |
| | | } |
| | | @Bean |
| | | public Binding orderDelayBindTtlNoTime() { |
| | | return BindingBuilder.bind(orderDelayQueueTtlNoTime()) |
| | | .to(delayExchangeTtlNoTime()) |
| | | .with(RabbitQueueEnum.NO_TIME_TTL.getRoute()); |
| | | } |
| | | @Bean |
| | | public Queue orderDelayQueueTtlNoTime() { |
| | | return QueueBuilder.durable(RabbitQueueEnum.NO_TIME_TTL.getQueue()) |
| | | //到期后转发的交换机 |
| | | .withArgument("x-dead-letter-exchange", RabbitQueueEnum.NO_TIME.getExchange()) |
| | | //到期后转发的路由键 |
| | | .withArgument("x-dead-letter-routing-key", RabbitQueueEnum.NO_TIME.getRoute()) |
| | | .build(); |
| | | } |
| | | @Bean |
| | | public DirectExchange orderDelayExchangeNoTime() { |
| | | return new DirectExchange(RabbitQueueEnum.NO_TIME.getExchange()); |
| | | } |
| | | @Bean |
| | | public Queue orderDelayQueueNoTime() { |
| | | return new Queue(RabbitQueueEnum.NO_TIME.getQueue()); |
| | | } |
| | | @Bean |
| | | public Binding orderDelayBindNoTime() { |
| | | return BindingBuilder.bind(orderDelayQueueNoTime()) |
| | | .to(orderDelayExchangeNoTime()) |
| | | .with(RabbitQueueEnum.NO_TIME.getRoute()); |
| | | } |
| | | // === 延时 end === |
| | | |
| | | |
| | | |
| | | // === 处理中奖 start === |
| | | @Bean |
| | | public DirectExchange openPriceExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.OPEN_PRICE.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue autoLevelUpAgentQueue() { |
| | | return new Queue(QueueConstants.AGENT_AUTO_LEVEL_UP); |
| | | public Queue openPriceQueue() { |
| | | return new Queue(RabbitQueueEnum.OPEN_PRICE.getQueue()); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding autoLevelUpBind() { |
| | | return BindingBuilder.bind(autoLevelUpAgentQueue()).to(defaultExchange()).with(RouteKeyConstants.ROUTE_KEY_DEFAULT); |
| | | public Binding openPriceBind() { |
| | | return BindingBuilder.bind(openPriceQueue()).to(openPriceExchange()).with(RabbitQueueEnum.OPEN_PRICE.getRoute()); |
| | | } |
| | | |
| | | @Bean |
| | | public DirectExchange agentReturnMoneyExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.AGENT_REUTRN_MONEY.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue agentReturnMoneyQueue() { |
| | | return new Queue(QueueConstants.AGENT_RETURN_MONEY); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding agentReturnMoneyBind() { |
| | | return BindingBuilder.bind(agentReturnMoneyQueue()).to(agentReturnMoneyExchange()).with(RabbitQueueEnum.AGENT_REUTRN_MONEY.getRoute()); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public DirectExchange orderReturnMoneyExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.ORDER_RETURN_MONEY.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue orderReturnMoneyQueue() { |
| | | return new Queue(QueueConstants.ORDER_RETURN_MONEY); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding orderReturnMoneyBind() { |
| | | return BindingBuilder.bind(orderReturnMoneyQueue()).to(orderReturnMoneyExchange()).with(RabbitQueueEnum.ORDER_RETURN_MONEY.getRoute()); |
| | | } |
| | | |
| | | /** |
| | | * 补贴金额 |
| | | * @return |
| | | */ |
| | | //补贴金额 start |
| | | @Bean |
| | | public DirectExchange perkMoneyExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.PERK_MONEY.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue perkMoneyQueue() { |
| | | return new Queue(QueueConstants.PERK_MONEY); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding perkMoneyBind() { |
| | | return BindingBuilder.bind(perkMoneyQueue()).to(perkMoneyExchange()).with(RabbitQueueEnum.PERK_MONEY.getRoute()); |
| | | } |
| | | //补贴金额 end |
| | | |
| | | /** |
| | | * 强制卖出 |
| | | * @return |
| | | */ |
| | | //强制卖出 start |
| | | @Bean |
| | | public DirectExchange forceVoucherSaleExchange() { |
| | | return new DirectExchange(RabbitQueueEnum.FORCE_VOUCHER_SALE.getExchange()); |
| | | } |
| | | |
| | | @Bean |
| | | public Queue forceVoucherSaleQueue() { |
| | | return new Queue(QueueConstants.FORCE_VOUCHER_SALE); |
| | | } |
| | | |
| | | @Bean |
| | | public Binding forceVoucherSaleBind() { |
| | | return BindingBuilder.bind(forceVoucherSaleQueue()).to(forceVoucherSaleExchange()).with(RabbitQueueEnum.FORCE_VOUCHER_SALE.getRoute()); |
| | | } |
| | | //强制卖出 end |
| | | // === 处理中奖 end === |
| | | |
| | | } |
| | |
| | | registration.excludePathPatterns("/api/login/pwdForget");
|
| | | registration.excludePathPatterns("/api/login/addRegisterAppeal");
|
| | | registration.excludePathPatterns("/api/common/**");
|
| | | registration.excludePathPatterns("/api/cj/**");
|
| | | registration.excludePathPatterns("/api/category/**");
|
| | | registration.excludePathPatterns("/api/goods/**");
|
| | | registration.excludePathPatterns("/api/pay/**");
|
| | |
| | | @Getter |
| | | public enum DataDictionaryEnum { |
| | | /** |
| | | * 停止开关 |
| | | */ |
| | | NO_TIME("NO_TIME","NO_TIME"), |
| | | /** |
| | | * 时间间隔 |
| | | */ |
| | | TIME_INTERVAL("TIME_INTERVAL","TIME_INTERVAL"), |
| | | /** |
| | | * 银行转账设置-客户号 |
| | | */ |
| | | BANK_TRANS_softwareId("BANK_TRANS_SET","BANK_TRANS_softwareId"), |
New file |
| | |
| | | package cc.mrbird.febs.common.enumerates; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * |
| | | * 1-静态收益 2-直推奖 3-代理收益 4-排名收益 5-总监收益 6-社区点补 7-一代收益 8-提现 9-转增 10-支付 11-退款 |
| | | * @author wzy |
| | | * @date 2021-09-24 |
| | | **/ |
| | | @Getter |
| | | public enum MoneyFlowTypeNewEnum { |
| | | STATIC_BONUS(1,"投注"), |
| | | DYNAMIC_ACHIEVE(2,"中奖"), |
| | | AGENT_BONUS(3,"充值"), |
| | | RANK_BONUS(4,"提现"); |
| | | |
| | | private final int value; |
| | | private final String description; |
| | | |
| | | MoneyFlowTypeNewEnum(int value,String description) { |
| | | this.value = value; |
| | | this.description = description; |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.common.utils;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class AppContants {
|
| | |
|
| | | public static final String KJ_RECORD_NO_OLD = "KJ_NO_OLD";//上一期的开奖编号
|
| | | public static final String KJ_RECORD_NUM_OLD = "KJ_NUM_OLD";//上一期的开奖编号
|
| | | public static final String KJ_RECORD_NO = "KJ_NO";//开奖编号
|
| | | public static final String KJ_RECORD_TIME = "KJ_TIME";//开奖时间
|
| | |
|
| | | /**
|
| | | * 系统用户
|
| | | */
|
| | | public static final String PUBLIC_CODE = "system_add_member";
|
| | | public static final String SYSTEM_USER = "system";
|
| | |
|
| | | public static final String PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzIfAF0gZs9zn9ENRtz6ocHa8MGljmMmCsjLsRvTIAilBMypMJz/VNooAOhd8GTdsWm8FNGVhRauv7RfxorFJ4Um2UbweUQBIZP2pzZMnclHxhUmYZsn/6IaPzijiUNfEjygtE7ezvso/67ecZJwqfrtlbEjqUbRgo17Qj23suwQIDAQAB";
|
| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelSheetPO; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelUtil; |
| | | import cc.mrbird.febs.common.utils.excl.ExcelVersion; |
| | |
| | | public FebsResponse memberAdd(MallMember member) { |
| | | RegisterDto registerDto = new RegisterDto(); |
| | | registerDto.setAccount(member.getAccount()); |
| | | registerDto.setRegistType("admin"); |
| | | registerDto.setPassword("a123456"); |
| | | registerDto.setInviteId(member.getInviteId()); |
| | | registerDto.setName(member.getName()); |
| | | registerDto.setCode(AppContants.PUBLIC_CODE); |
| | | apiMallMemberService.register(registerDto); |
| | | return new FebsResponse().success(); |
| | | } |
| | |
| | | GreenScoreEnum.SCORE_PRICE.getType(), |
| | | GreenScoreEnum.SCORE_PRICE.getCode() |
| | | ); |
| | | agentProducer.sendForceVoucherSaleMsg(scorePriceDic.getValue()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
New file |
| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.ApiCreateDto; |
| | | import cc.mrbird.febs.mall.dto.KjRecordDto; |
| | | import cc.mrbird.febs.mall.service.CJService; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @CrossOrigin("*") |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping(value = "/api/cj") |
| | | @Api(value = "ApiCjController", tags = "抽奖类") |
| | | public class ApiCjController { |
| | | |
| | | private final CJService cjService; |
| | | |
| | | @ApiOperation(value = "历史中奖号码") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiKjRecordVo.class) |
| | | }) |
| | | @PostMapping(value = "/kjRecord") |
| | | public FebsResponse kjRecord(@RequestBody KjRecordDto kjRecordDto) { |
| | | return cjService.kjRecord(kjRecordDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "首页头部信息", notes = "首页头部信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiKjInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/kjInfo") |
| | | public FebsResponse kjInfo() { |
| | | return cjService.kjInfo(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "首页下注信息", notes = "首页下注信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiTzInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/tzInfo") |
| | | public FebsResponse tzInfo() { |
| | | return cjService.tzInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "马上投注", notes = "马上投注") |
| | | @PostMapping(value = "/create") |
| | | public FebsResponse create(@RequestBody ApiCreateDto apiCreateDto) { |
| | | return cjService.create(apiCreateDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "投注列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiTzListVo.class) |
| | | }) |
| | | @PostMapping(value = "/tzInfoList") |
| | | public FebsResponse tzInfoList(@RequestBody KjRecordDto kjRecordDto) { |
| | | return cjService.tzInfoList(kjRecordDto); |
| | | } |
| | | } |
| | |
| | | |
| | | private final IApiMallMemberService memberService; |
| | | |
| | | @ApiOperation(value = "app注册接口", notes = "app注册接口") |
| | | @ApiOperation(value = "创建账户", notes = "创建账户") |
| | | @PostMapping(value = "/register") |
| | | public FebsResponse register(@RequestBody RegisterDto registerDto) { |
| | | return memberService.register(registerDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "账号密码登录接口", notes = "账号密码登录接口") |
| | | @ApiOperation(value = "登录", notes = "登录") |
| | | @PostMapping(value = "/toLogin") |
| | | public FebsResponse login(@RequestBody LoginDto loginDto) { |
| | | return memberService.toLogin(loginDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "忘记/修改密码", notes = "忘记/修改密码") |
| | | @ApiOperation(value = "修改密码", notes = "修改密码") |
| | | @PostMapping(value = "/forgetPwd") |
| | | public FebsResponse forgetPwd(@RequestBody ForgetPwdDto forgetPwdDto) { |
| | | return memberService.forgetPwd(forgetPwdDto); |
| | |
| | | return memberService.pwdForget(forgetPwdDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "提交注册申诉", notes = "提交注册申诉") |
| | | @PostMapping(value = "addRegisterAppeal") |
| | | public FebsResponse addRegisterAppeal(@RequestBody RegisterAppealDto registerAppeal) { |
| | | memberService.addRegisterAppeal(registerAppeal); |
| | | return new FebsResponse().success().message("申请成功"); |
| | | } |
| | | } |
| | |
| | | @CrossOrigin("*") |
| | | @RequestMapping(value = "/api/member") |
| | | @RequiredArgsConstructor |
| | | @Api(value = "ApiMallMemberController", tags = "商城用户接口类") |
| | | @Api(value = "ApiMallMemberController", tags = "我的接口类") |
| | | public class ApiMallMemberController { |
| | | |
| | | private final IApiMallMemberService memberService; |
| | | private final IMallMemberWithdrawService mallMemberWithdrawService; |
| | | private final IApiMallMemberWalletService walletService; |
| | | |
| | | @ApiOperation(value = "获取商城用户信息", notes = "获取商城用户信息") |
| | | @ApiOperation(value = "获取用户信息", notes = "获取用户信息") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MallMemberVo.class) |
| | | }) |
| | |
| | | return memberService.logout(); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取购物车、订单等角标数量") |
| | | @GetMapping(value = "/findMarkCnt") |
| | | public FebsResponse findMarkCnt() { |
| | | return memberService.findMemberMarkCnt(); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置支付密码") |
| | | @PostMapping(value = "/setTradePwd") |
| | | public FebsResponse setTradePwd(@RequestBody ForgetPwdDto forgetPwdDto) { |
| | | return memberService.setTradePwd(forgetPwdDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户信息") |
| | | @PostMapping(value = "/modifyInfo") |
| | | public FebsResponse modifyInfo(@RequestBody ModifyMemberInfoDto modifyMemberInfoDto) { |
| | | return memberService.modifyMemberInfo(modifyMemberInfoDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的团队列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MyTeamVo.class) |
| | | }) |
| | | @PostMapping(value = "/teamList") |
| | | public FebsResponse teamList(@RequestBody TeamListDto teamListDto) { |
| | | return memberService.teamList(teamListDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "资金流水列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = MoneyFlowVo.class) |
| | |
| | | return memberService.moneyFlows(moneyFlowDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "转账") |
| | | @PostMapping(value = "/transfer") |
| | | public FebsResponse transfer(@RequestBody @Validated TransferDto transferDto) { |
| | | memberService.transfer(transferDto); |
| | | return new FebsResponse().success().message("转账成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "提现规则", notes = "提现规则") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = CashOutSettingVo.class) |
| | | }) |
| | | @GetMapping(value = "/cashOutSetting") |
| | | public FebsResponse cashOutSetting() { |
| | | return new FebsResponse().success().data(memberService.cashOutSetting()); |
| | | } |
| | | |
| | | @ApiOperation(value = "提现") |
| | | @ApiOperation(value = "提现", notes = "提现") |
| | | @PostMapping(value = "/withdrawal") |
| | | public FebsResponse withdrawal(@RequestBody @Validated WithdrawalDto withdrawalDto) { |
| | | mallMemberWithdrawService.withdrawal(withdrawalDto); |
| | | return new FebsResponse().success().message("提交成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置收款方式") |
| | | @PostMapping(value = "/setPayment") |
| | | public FebsResponse setPayment(@RequestBody MallMemberPayment mallMemberPayment) { |
| | | memberService.setPayment(mallMemberPayment); |
| | | return new FebsResponse().success().message("设置成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取收款方式") |
| | | @GetMapping(value = "/findPayment") |
| | | public FebsResponse findPayment() { |
| | | return new FebsResponse().success().data(memberService.findMemberPayment()); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定手机号") |
| | | @PostMapping(value = "/bindPhone") |
| | | public FebsResponse bindPhone(@RequestBody AccountAndCodeDto accountAndCodeDto) { |
| | | memberService.bindPhone(accountAndCodeDto); |
| | | return new FebsResponse().success().message("绑定成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "可提现金额") |
| | | @GetMapping(value = "/canWithdrawal") |
| | | public FebsResponse canWithdrawal() { |
| | | return new FebsResponse().success().data(memberService.canMoney()); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户消费排名") |
| | | @PostMapping(value = "/findRankList") |
| | | public FebsResponse findRankList(@RequestBody RankListDto rankListDto) { |
| | | // return new FebsResponse().success().data(memberService.findRankList(rankListDto)); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据邀请码或者手机号获取昵称") |
| | | @PostMapping(value = "/findMemberInfoByAccount/{phone}") |
| | | public FebsResponse findMemberInfoByAccount(@PathVariable("phone") String phone) { |
| | | MallMember account = memberService.findMemberInfoByAccount(phone); |
| | | if (account == null) { |
| | | return new FebsResponse().fail().message("用户不存在"); |
| | | } |
| | | |
| | | MallMemberVo member = new MallMemberVo(); |
| | | member.setName(account.getName()); |
| | | return new FebsResponse().success().data(member); |
| | | } |
| | | |
| | | @ApiOperation(value = "佣金划转") |
| | | @PostMapping(value = "/commissionChange") |
| | | public FebsResponse commissionChange(@RequestBody @Validated CommissionChangeDto commissionChange) { |
| | | walletService.commissionChange(commissionChange); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的权益") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = MyCommissionVo.class) |
| | | ) |
| | | @PostMapping(value = "/myCommission") |
| | | public FebsResponse myCommission() { |
| | | return new FebsResponse().success().data(memberService.myCommission()); |
| | | } |
| | | |
| | | @ApiOperation(value = "商铺申请是否存在") |
| | | @PostMapping(value = "/shopApplyIsExist") |
| | | public FebsResponse shopApplyIsExist() { |
| | | return null; |
| | | } |
| | | |
| | | @ApiOperation(value = "新增银行卡") |
| | |
| | | @PostMapping(value = "/delMemberBank/{id}") |
| | | public FebsResponse delMemberBank(@PathVariable("id") Long id) { |
| | | return memberService.delMemberBank(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "银行名称列表", notes = "银行名称列表") |
| | | @GetMapping(value = "/memberBankName") |
| | | public FebsResponse memberBankDetails() { |
| | | return memberService.findBankName(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.conversion; |
| | | |
| | | import cc.mrbird.febs.mall.entity.CjInfo; |
| | | import cc.mrbird.febs.mall.vo.ApiTzListVo; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public abstract class CjInfoConversion { |
| | | |
| | | public static final CjInfoConversion INSTANCE = Mappers.getMapper(CjInfoConversion.class); |
| | | public abstract List<ApiTzListVo> entitysToVos(List<CjInfo> cjInfos); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.conversion; |
| | | |
| | | import cc.mrbird.febs.mall.entity.TzInfo; |
| | | import cc.mrbird.febs.mall.vo.ApiTzInfoVo; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | |
| | | @Mapper |
| | | public abstract class TzInfoConversion { |
| | | |
| | | public static final TzInfoConversion INSTANCE = Mappers.getMapper(TzInfoConversion.class); |
| | | |
| | | public abstract ApiTzInfoVo entityToVo(TzInfo tzInfo); |
| | | } |
| | |
| | | @ApiModel(value = "AddMemberBankDto", description = "参数接收类") |
| | | public class AddMemberBankDto { |
| | | |
| | | // 姓名 |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | //证件类型 |
| | | @ApiModelProperty(value = "证件类型") |
| | | private String idType; |
| | | //证件号码 |
| | | @ApiModelProperty(value = "证件号码") |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCardNum; |
| | | // 银行卡号 |
| | | @ApiModelProperty(value = "银行卡号") |
| | | @ApiModelProperty(value = "卡号") |
| | | private String bankNo; |
| | | // 银行卡号 |
| | | @ApiModelProperty(value = "数字账号") |
| | | private String digitalNo; |
| | | // 手机号 |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | // 开户行 |
| | | @ApiModelProperty(value = "开户行") |
| | | private String bankName; |
| | | // 开户行 |
| | | @ApiModelProperty(value = "支行") |
| | | private String subbranchName; |
| | | // 省 |
| | | @ApiModelProperty(value = "省") |
| | | private String province; |
| | | // 市 |
| | | @ApiModelProperty(value = "市") |
| | | private String city; |
| | | |
| | | @ApiModelProperty(value = "区") |
| | | private String qu; |
| | | // 收款行号 |
| | | @ApiModelProperty(value = "收款行号") |
| | | private String skhh; |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiCreateDto", description = "参数接收类") |
| | | public class ApiCreateDto { |
| | | @ApiModelProperty(value = "投注记录") |
| | | private List<ApiCreateItemDto> items; |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiCreateItemDto", description = "参数接收类") |
| | | public class ApiCreateItemDto { |
| | | |
| | | @ApiModelProperty(value = "首页下注信息ID") |
| | | private Long id;//类型 1-按大小 2-按单双 3-按数字 |
| | | |
| | | @ApiModelProperty(value = "投注金额") |
| | | private BigDecimal tzAmount;//值 |
| | | |
| | | } |
| | |
| | | @ApiModel(value = "ForgetPwdDto", description = "忘记/修改密码参数接收类") |
| | | public class ForgetPwdDto { |
| | | |
| | | @ApiModelProperty(value = "登录账号", example = "15773001234") |
| | | private String accountLogin; |
| | | |
| | | @NotBlank(message = "账号不能为空") |
| | | @ApiModelProperty(value = "账号", example = "15773001234") |
| | | private String phone; |
| | | |
| | | @NotBlank(message = "绑定号码不能为空") |
| | | @ApiModelProperty(value = "绑定号码", example = "15773001234") |
| | | private String account; |
| | | |
| | | @NotBlank(message = "密码不能为空") |
| | | @ApiModelProperty(value = "新密码", example = "123456") |
| | | @ApiModelProperty(value = "密码", example = "123456") |
| | | private String password; |
| | | |
| | | @NotBlank(message = "确认密码不能为空") |
| | | @ApiModelProperty(value = "确认密码", example = "123456") |
| | | private String passwordAgain; |
| | | |
| | | @NotBlank(message = "验证码不能为空") |
| | | @ApiModelProperty(value = "验证码", example = "123456") |
| | | private String code; |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-09-24 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "KjRecordDto", description = "接收参数类") |
| | | public class KjRecordDto { |
| | | |
| | | @ApiModelProperty(value = "一页多少个", example = "10") |
| | | private Integer pageSize; |
| | | |
| | | @ApiModelProperty(value = "页码", example = "1") |
| | | private Integer pageNum; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long memberId; |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class OpenPrice implements Serializable { |
| | | private static final long serialVersionUID = -1277171780468841527L; |
| | | private String kjNo; |
| | | private String kjNum; |
| | | } |
| | |
| | | * @date 2021-09-16 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "RegisterDto", description = "用户注册参数接收类") |
| | | @ApiModel(value = "RegisterDto", description = "创建用户") |
| | | public class RegisterDto { |
| | | |
| | | @NotBlank(message = "账号不能为空") |
| | | @ApiModelProperty(value = "账号", example = "hjsj") |
| | | private String accountLogin; |
| | | |
| | | @NotBlank(message = "手机号不能为空") |
| | | @ApiModelProperty(value = "手机号", example = "15773001234") |
| | | @NotBlank(message = "用户名不能为空") |
| | | @ApiModelProperty(value = "用户名", example = "15773001234") |
| | | private String account; |
| | | |
| | | @NotBlank(message = "姓名不能为空") |
| | | @ApiModelProperty(value = "姓名", example = "王大洋") |
| | | private String name; |
| | | |
| | | @NotBlank(message = "密码不能为空") |
| | | @ApiModelProperty(value = "密码", example = "123456") |
| | | private String password; |
| | | |
| | | @ApiModelProperty(value = "类型 1-手机号 2-邮箱", example = "1") |
| | | private String type = "1"; |
| | | @NotBlank(message = "确认密码不能为空") |
| | | @ApiModelProperty(value = "确认密码", example = "123456") |
| | | private String passwordAgain; |
| | | |
| | | @NotBlank(message = "验证码不能为空") |
| | | @ApiModelProperty(value = "验证码", example = "123456") |
| | | private String code; |
| | | |
| | | @NotBlank(message = "邀请码不能为空") |
| | | @ApiModelProperty(value = "邀请码") |
| | | private String inviteId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String registType; |
| | | |
| | | } |
| | |
| | | @Data |
| | | @ApiModel(value = "UpdateMemberBankDto", description = "参数接收类") |
| | | public class UpdateMemberBankDto { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | // 姓名 |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | //证件类型 |
| | | @ApiModelProperty(value = "证件类型") |
| | | private String idType; |
| | | //证件号码 |
| | | @ApiModelProperty(value = "证件号码") |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCardNum; |
| | | // 银行卡号 |
| | | @ApiModelProperty(value = "银行卡号") |
| | | @ApiModelProperty(value = "卡号") |
| | | private String bankNo; |
| | | // 手机号 |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | // 银行卡号 |
| | | @ApiModelProperty(value = "数字账号") |
| | | private String digitalNo; |
| | | // 开户行 |
| | | @ApiModelProperty(value = "开户行") |
| | | private String bankName; |
| | | @ApiModelProperty(value = "支行") |
| | | private String subbranchName; |
| | | // 省 |
| | | @ApiModelProperty(value = "省") |
| | | private String province; |
| | | // 市 |
| | | @ApiModelProperty(value = "市") |
| | | private String city; |
| | | @ApiModelProperty(value = "区") |
| | | private String qu; |
| | | // 收款行号 |
| | | @ApiModelProperty(value = "收款行号") |
| | | private String skhh; |
| | | } |
| | |
| | | public class WithdrawalDto { |
| | | |
| | | @Min(0) |
| | | @NotNull(message = "参数不能为空") |
| | | @NotNull(message = "金额不能为空") |
| | | @ApiModelProperty(value = "金额") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "绿色积分数量") |
| | | private BigDecimal voucherCnt; |
| | | |
| | | @NotBlank(message = "参数不能为空") |
| | | @ApiModelProperty(value = "交易密码") |
| | | private String tradePwd; |
| | | |
| | | @ApiModelProperty(value = "银行卡号") |
| | | private String bankNo; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | |
| | | @NotNull(message = "银行卡不能为空") |
| | | @ApiModelProperty(value = "用户银行卡ID") |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName("cj_info") |
| | | public class CjInfo extends BaseEntity { |
| | | private Long memberId;// |
| | | private BigDecimal totalAmount;//投注总金额 |
| | | private String kjNo;//开奖编号 |
| | | private String kjNum;//开奖数字 |
| | | private Integer kjState;//是否开奖 0-未开奖 1-已开奖 |
| | | private Integer zjState;//中奖状态 0-未中奖 1-中奖 |
| | | private BigDecimal perkAmount;//中奖总金额 |
| | | @TableField(exist = false) |
| | | private List<CjItem> items; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @TableName("cj_item") |
| | | public class CjItem extends BaseEntity { |
| | | |
| | | private Long infoId;//主表ID |
| | | private Long memberId;// |
| | | private Long tzId;//投注信息ID |
| | | private Integer type;//投注类型 1-按大小 2-按单双 3-按数字 |
| | | private BigDecimal amount;//投入金额 |
| | | private String itemNum;//投注数字 |
| | | private String kjNum;//中奖号码 |
| | | private BigDecimal perkAmount;//中奖金额 |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("kj_record") |
| | | public class KjRecord extends BaseEntity { |
| | | private String kjNo;//开奖编号 |
| | | private String kjNum;//开奖数字 |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | |
| | | private String aliAccount; |
| | | |
| | | /** |
| | | * 持卡人姓名 |
| | | */ |
| | | @ApiModelProperty(value = "姓名") |
| | | private String bankName; |
| | | |
| | | /** |
| | | * 银行卡号 |
| | | */ |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCardNo; |
| | | @ApiModelProperty(value = "卡号") |
| | | private String bankNo; |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 开户行 |
| | | */ |
| | | private String bank; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @TableName("tz_info") |
| | | public class TzInfo extends BaseEntity { |
| | | |
| | | private Integer type;//类型 1-按大小 2-按单双 3-按数字 |
| | | private String tzCode;//值 |
| | | private BigDecimal tzPercent;//获奖倍率 |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.KjRecordDto; |
| | | import cc.mrbird.febs.mall.entity.CjInfo; |
| | | import cc.mrbird.febs.mall.vo.ApiTzListVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface CjInfoMapper extends BaseMapper<CjInfo> { |
| | | |
| | | IPage<CjInfo> selectTzListByMemberId(IPage<CjInfo> page, @Param("record")KjRecordDto kjRecordDto); |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.CjItem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | public interface CjItemMapper extends BaseMapper<CjItem> { |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.KjRecordDto; |
| | | import cc.mrbird.febs.mall.entity.KjRecord; |
| | | import cc.mrbird.febs.mall.vo.ApiKjRecordVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface KjRecordMapper extends BaseMapper<KjRecord> { |
| | | |
| | | IPage<ApiKjRecordVo> selectListInPage(IPage<ApiKjRecordVo> page, KjRecordDto kjRecordDto); |
| | | |
| | | KjRecord selectOneByLimitZero(@Param("limitFrom")int limitFrom, @Param("limitSize")int limitSize); |
| | | |
| | | KjRecord selectKjNo(@Param("kjNo")String kjNo); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.TzInfo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | public interface TzInfoMapper extends BaseMapper<TzInfo> { |
| | | } |
| | |
| | | @Autowired |
| | | private MallOrderInfoMapper orderInfoMapper; |
| | | |
| | | @Scheduled(cron = "0 0/5 * * * ? ") |
| | | public void overtimeJob() { |
| | | log.info("订单超时任务执行"); |
| | | List<MallOrderInfo> orderList = orderInfoMapper.selectOrderInfoByStatus(OrderStatusEnum.WAIT_PAY.getValue()); |
| | | if (CollUtil.isNotEmpty(orderList)) { |
| | | for (MallOrderInfo orderInfo : orderList) { |
| | | long subTime = DateUtil.between(orderInfo.getOrderTime(), new Date(), DateUnit.MINUTE, false); |
| | | |
| | | if (subTime > 15) { |
| | | orderInfo.setStatus(OrderStatusEnum.CANCEL.getValue()); |
| | | orderInfo.setCancelType(MallOrderInfo.CANCEL_OVERTIME_NO_PAY); |
| | | orderInfoMapper.updateById(orderInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | // @Scheduled(cron = "0 0/5 * * * ? ") |
| | | // public void overtimeJob() { |
| | | // log.info("订单超时任务执行"); |
| | | // List<MallOrderInfo> orderList = orderInfoMapper.selectOrderInfoByStatus(OrderStatusEnum.WAIT_PAY.getValue()); |
| | | // if (CollUtil.isNotEmpty(orderList)) { |
| | | // for (MallOrderInfo orderInfo : orderList) { |
| | | // long subTime = DateUtil.between(orderInfo.getOrderTime(), new Date(), DateUnit.MINUTE, false); |
| | | // |
| | | // if (subTime > 15) { |
| | | // orderInfo.setStatus(OrderStatusEnum.CANCEL.getValue()); |
| | | // orderInfo.setCancelType(MallOrderInfo.CANCEL_OVERTIME_NO_PAY); |
| | | // orderInfoMapper.updateById(orderInfo); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | } |
| | |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 自动确认收货 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void orderAutoConfirmJob() { |
| | | log.info("自动确认收货"); |
| | | mallOrderInfoMapper.updateOrderConfirmStatus(DateUtil.offsetDay(new Date(), -7)); |
| | | } |
| | | // /** |
| | | // * 自动确认收货 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 0 * * ?") |
| | | // public void orderAutoConfirmJob() { |
| | | // log.info("自动确认收货"); |
| | | // mallOrderInfoMapper.updateOrderConfirmStatus(DateUtil.offsetDay(new Date(), -7)); |
| | | // } |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.entity.MallMoneyFlow; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMoneyFlowMapper; |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.mall.service.impl.CommonService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | |
| | | public class ProfitJob { |
| | | |
| | | @Autowired |
| | | private IMemberProfitService memberProfitService; |
| | | @Autowired |
| | | private IAgentService agentService; |
| | | |
| | | private CJService cjService; |
| | | /** |
| | | * 代理分红 |
| | | * 十分钟开奖一次 |
| | | * 生成一条开奖记录(只生成编号) |
| | | * 十分钟延迟的消息队列去开奖(产生一个中奖号码) |
| | | */ |
| | | // @Scheduled(cron = "0 30 0 * * ?") |
| | | // public void profitJob() { |
| | | // memberProfitService.agentProfit(null); |
| | | // } |
| | | |
| | | // @Scheduled(cron = "0 30 1 * * ?") |
| | | // public void storeAndDirectorJob() { |
| | | // memberProfitService.storeAndDirectorProfit(null); |
| | | // } |
| | | |
| | | // /** |
| | | // * 线下服务中心补贴 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 1 * * ?") |
| | | // public void thankfulJob() { |
| | | // memberProfitService.thankfulProfit(null); |
| | | // } |
| | | |
| | | /** |
| | | * 代理商补贴 TODO 需要去掉注释 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void agentPerkJob() { |
| | | memberProfitService.agentPerkJob(null); |
| | | @Scheduled(cron = "0 0/10 * * * ? ") |
| | | public void createKjRecord() { |
| | | cjService.createKjRecord(); |
| | | } |
| | | |
| | | /** |
| | | * 线下服务中心补贴 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void offLinePerkJob() { |
| | | memberProfitService.offLinePerkJob(null); |
| | | } |
| | | |
| | | /** |
| | | * 平级奖励补贴 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void teamEqualsPerkJob() { |
| | | memberProfitService.teamEqualsPerkJob(null); |
| | | } |
| | | |
| | | /** |
| | | * 补贴消息--重试 |
| | | * 一个小时运行一次 |
| | | */ |
| | | @Scheduled(cron = "0 0/5 * * * ?") |
| | | public void mqPerkRetryJob() { |
| | | memberProfitService.mqPerkRetryJob(); |
| | | } |
| | | /** |
| | | * 联创、合伙人的每日绿色凭证释放 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void scoreRecordReleaseJob() { |
| | | memberProfitService.scoreRecordReleaseJob(); |
| | | } |
| | | |
| | | /** |
| | | * 业绩产生凭证 |
| | | */ |
| | | @Scheduled(cron = "0 0 1 * * ?") |
| | | public void achieveReleaseJob() { |
| | | memberProfitService.achieveReleaseJob(); |
| | | } |
| | | |
| | | /** |
| | | * 代理星级补贴 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void perkAgentAchieveJob() { |
| | | agentService.perkAgent(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 静态分红 |
| | | */ |
| | | // @Scheduled(cron = "0 0 0 * * ?") |
| | | // public void staticProfitJob() { |
| | | // memberProfitService.staticProfit(null); |
| | | // } |
| | | |
| | | /** |
| | | * 排名奖 每月1号 |
| | | */ |
| | | // @Scheduled(cron = "0 30 0 1 * ?") |
| | | // public void rankJob() { |
| | | // memberProfitService.rankProfit(); |
| | | // } |
| | | |
| | | /** |
| | | * 积分池,所有消费拿出10%放到积分池,然后按1%每天释放加权平分 |
| | | */ |
| | | // @Scheduled(cron = "0 0 2 * * ?") |
| | | // @Scheduled(cron = "0 0/5 * * * ? ") |
| | | // public void scorePool() { |
| | | // memberProfitService.scorePool(); |
| | | // } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.service; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.ApiCreateDto; |
| | | import cc.mrbird.febs.mall.dto.KjRecordDto; |
| | | import cc.mrbird.febs.mall.entity.CjInfo; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface CJService extends IService<CjInfo> { |
| | | |
| | | FebsResponse kjRecord(KjRecordDto kjRecordDto); |
| | | |
| | | /** |
| | | * 十分钟开奖一次 |
| | | * 生成一条开奖记录(只生成编号) |
| | | * 十分钟延迟的消息队列去开奖(产生一个中奖号码) |
| | | */ |
| | | void createKjRecord(); |
| | | |
| | | FebsResponse kjInfo(); |
| | | |
| | | void getChouJiangDelayMsg(String kjNo); |
| | | |
| | | FebsResponse tzInfo(); |
| | | |
| | | FebsResponse create(ApiCreateDto apiCreateDto); |
| | | |
| | | FebsResponse tzInfoList(KjRecordDto kjRecordDto); |
| | | |
| | | void getNoTimeDelayMsg(String kjNo); |
| | | |
| | | void getOpenPriceMsg(String kjNo, String kjNum); |
| | | } |
| | |
| | | |
| | | MallShopApply findNewestApply(); |
| | | |
| | | void addRegisterAppeal(RegisterAppealDto registerAppeal); |
| | | |
| | | CashOutSettingVo cashOutSetting(); |
| | | |
| | | List<ShopListVo> findShopListVo(ShopListDto shopListDto); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public FebsResponse register(RegisterDto registerDto) { |
| | | // MallMember mallMember = this.baseMapper.selectInfoByAccount(registerDto.getAccount()); |
| | | // if (mallMember != null) { |
| | | // throw new FebsException("该账号已被占用"); |
| | | // } |
| | | String accountLogin = registerDto.getAccountLogin(); |
| | | MallMember mallMember = this.baseMapper.selectByAccountLogin(accountLogin); |
| | | if (mallMember != null) { |
| | | throw new FebsException("该账号已被占用"); |
| | | } |
| | | |
| | | // List<MallMember> mallMembers = this.baseMapper.selectMemberByName(registerDto.getName()); |
| | | // if (CollUtil.isNotEmpty(mallMembers)) { |
| | | // MallRegisterAppeal registerAppeal = mallRegisterAppealMapper.selectByPhoneAndName(registerDto.getName(), registerDto.getAccount()); |
| | | // if (registerAppeal == null || registerAppeal.getStatus() != 1) { |
| | | // return new FebsResponse().code(HttpStatus.ACCEPTED).message("用户名已存在"); |
| | | // } |
| | | // } |
| | | |
| | | String account = registerDto.getAccount(); |
| | | if (!"admin".equals(registerDto.getRegistType())) { |
| | | String code = registerDto.getCode(); |
| | | MallMember mallMember = this.baseMapper.selectInfoByAccount(account); |
| | | if (mallMember != null) { |
| | | throw new FebsException("账号已注册"); |
| | | } |
| | | String code = registerDto.getCode(); |
| | | if(!AppContants.PUBLIC_CODE.equals(code)){ |
| | | boolean flags = commonService.verifyCode(account, code); |
| | | if (!flags) { |
| | | throw new FebsException("验证码错误"); |
| | | } |
| | | } |
| | | |
| | | mallMember = new MallMember(); |
| | | mallMember.setAccountLogin(accountLogin); |
| | | mallMember.setAccountLogin(account); |
| | | mallMember.setPassword(SecureUtil.md5(registerDto.getPassword())); |
| | | |
| | | // 判断账号类型 |
| | | if (AppContants.ACCOUNT_TYPE_MOBILE.equals(registerDto.getType())) { |
| | | mallMember.setPhone(registerDto.getAccount()); |
| | | } else { |
| | | mallMember.setEmail(registerDto.getAccount()); |
| | | } |
| | | |
| | | Integer count = this.baseMapper.selectCount(null); |
| | | if (count != null && count != 0) { |
| | | MallMember inviteMember = this.baseMapper.selectInfoByInviteId(registerDto.getInviteId()); |
| | | if (inviteMember == null) { |
| | | throw new FebsException("邀请码不存在"); |
| | | } |
| | | |
| | | mallMember.setReferrerId(registerDto.getInviteId()); |
| | | |
| | | } |
| | | mallMember.setName(registerDto.getName()); |
| | | mallMember.setPhone(registerDto.getAccount()); |
| | | mallMember.setEmail(registerDto.getAccount()); |
| | | mallMember.setName(account); |
| | | mallMember.setAccountStatus(MallMember.ACCOUNT_STATUS_ENABLE); |
| | | mallMember.setAccountType(MallMember.ACCOUNT_TYPE_NORMAL); |
| | | mallMember.setLevel(AgentLevelEnum.ZERO_LEVEL.getCode()); |
| | | mallMember.setSex("男"); |
| | | mallMember.setBindPhone(registerDto.getAccount()); |
| | | |
| | | this.baseMapper.insert(mallMember); |
| | | |
| | | mallMember.setBindPhone(account); |
| | | String inviteId = ShareCodeUtil.toSerialCode(mallMember.getId()); |
| | | mallMember.setInviteId(inviteId); |
| | | |
| | | //推荐人和推荐人链 |
| | | boolean flag = false; |
| | | String parentId = mallMember.getReferrerId(); |
| | | if (StrUtil.isBlank(parentId)) { |
| | | flag = true; |
| | | } |
| | | String ids = ""; |
| | | while (!flag) { |
| | | if (StrUtil.isBlank(ids)) { |
| | | ids += parentId; |
| | | } else { |
| | | ids += ("," + parentId); |
| | | } |
| | | MallMember parentMember = this.baseMapper.selectInfoByInviteId(parentId); |
| | | if (parentMember == null) { |
| | | break; |
| | | } |
| | | parentId = parentMember.getReferrerId(); |
| | | if (StrUtil.isBlank(parentMember.getReferrerId())) { |
| | | flag = true; |
| | | } |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(ids)) { |
| | | mallMember.setReferrerIds(ids); |
| | | } |
| | | this.baseMapper.updateById(mallMember); |
| | | this.baseMapper.insert(mallMember); |
| | | |
| | | MallMemberWallet wallet = new MallMemberWallet(); |
| | | wallet.setBalance(BigDecimal.ZERO); |
| | | wallet.setMemberId(mallMember.getId()); |
| | | mallMemberWalletMapper.insert(wallet); |
| | | return new FebsResponse().success().message("注册成功"); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse toLogin(LoginDto loginDto) { |
| | | String md5Pwd = SecureUtil.md5(loginDto.getPassword()); |
| | | |
| | | // MallMember mallMember = this.baseMapper.selectInfoByAccountAndPwd(loginDto.getAccount(), md5Pwd); |
| | | MallMember mallMember = this.baseMapper.selectInfoByAccountLoginAndPwd(loginDto.getAccount(), md5Pwd); |
| | | MallMember mallMember = this.baseMapper.selectInfoByAccountAndPwd(loginDto.getAccount(), md5Pwd); |
| | | if (mallMember == null) { |
| | | throw new FebsException("用户不存在或账号密码错误"); |
| | | throw new FebsException("账号密码错误"); |
| | | } |
| | | |
| | | if (MallMember.ACCOUNT_STATUS_DISABLED.equals(mallMember.getAccountStatus())) { |
| | |
| | | Long id = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember mallMember = this.baseMapper.selectById(id); |
| | | |
| | | // MallMember mallMember = this.baseMapper.selectInfoByAccount(forgetPwdDto.getPhone()); |
| | | // MallMember mallMember = this.baseMapper.selectInfoByAccount(forgetPwdDto.getAccount()); |
| | | if (mallMember == null) { |
| | | throw new FebsException("账号不存在"); |
| | | } |
| | | |
| | | boolean b = commonService.verifyCode(forgetPwdDto.getAccount(), forgetPwdDto.getCode()); |
| | | boolean b = commonService.verifyCode(mallMember.getPhone(), forgetPwdDto.getCode()); |
| | | if (!b) { |
| | | throw new FebsException("验证码错误"); |
| | | } |
| | |
| | | mallMember.setPassword(pwd); |
| | | |
| | | this.baseMapper.updateById(mallMember); |
| | | return new FebsResponse().success().message("重置成功"); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse logout() { |
| | | Long id = LoginUserUtil.getLoginUser().getId(); |
| | | redisUtils.del(AppContants.APP_LOGIN_PREFIX + id); |
| | | return new FebsResponse().success().message("退出登录"); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse findMemberInfo() { |
| | | Long id = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember mallMember = this.baseMapper.selectById(id); |
| | | |
| | | MallMemberVo mallMemberVo = MallMemberConversion.INSTANCE.entityToVo(mallMember); |
| | | |
| | | MallMember referMember = this.baseMapper.selectInfoByInviteId(mallMember.getReferrerId()); |
| | | if (referMember != null) { |
| | | mallMemberVo.setReferrerName(referMember.getName()); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(mallMember.getTradePassword())) { |
| | | mallMemberVo.setHasTradePwd(1); |
| | | } |
| | | |
| | | MallMemberPayment payment = mallMemberPaymentMapper.selectByMemberId(id); |
| | | if (payment != null) { |
| | | mallMemberVo.setHasPayment(1); |
| | | } |
| | | |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(AppContants.AGENT_LEVEL, mallMember.getLevel()); |
| | | if (dic != null) { |
| | | mallMemberVo.setLevelName(dic.getDescription()); |
| | | } |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(mallMemberVo.getId()); |
| | | mallMemberVo.setBalance(wallet.getBalance()); |
| | | mallMemberVo.setScore(wallet.getScore()); |
| | | mallMemberVo.setPrizeScore(wallet.getPrizeScore()); |
| | | mallMemberVo.setTotalScore(wallet.getTotalScore()); |
| | | mallMemberVo.setStar(wallet.getStar()); |
| | | mallMemberVo.setVoucherCnt(wallet.getVoucherCnt()); |
| | | mallMemberVo.setTotalCost(mallOrderInfoMapper.selectTotalAmount(id)); |
| | | return new FebsResponse().success().data(mallMemberVo); |
| | | } |
| | | |
| | |
| | | public BigDecimal canMoney() { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | BigDecimal profit = mallMoneyFlowMapper.selectProfitByDateAndMemberId(memberId); |
| | | |
| | | BigDecimal canMoney = wallet.getCommission(); |
| | | if (profit != null) { |
| | | if(canMoney.compareTo(BigDecimal.ZERO) > 0) { |
| | | canMoney = canMoney.subtract(profit); |
| | | } |
| | | } |
| | | BigDecimal canMoney = wallet.getBalance(); |
| | | return canMoney; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void addRegisterAppeal(RegisterAppealDto registerAppeal) { |
| | | MallRegisterAppeal isExist = mallRegisterAppealMapper.selectByPhoneAndName(registerAppeal.getName(), registerAppeal.getPhone()); |
| | | if (isExist != null) { |
| | | throw new FebsException("申诉已存在"); |
| | | } |
| | | |
| | | isExist = new MallRegisterAppeal(); |
| | | isExist.setName(registerAppeal.getName()); |
| | | isExist.setPhone(registerAppeal.getPhone()); |
| | | isExist.setStatus(2); |
| | | |
| | | mallRegisterAppealMapper.insert(isExist); |
| | | } |
| | | |
| | | @Override |
| | | public CashOutSettingVo cashOutSetting() { |
| | | CashOutSettingVo cashOutSettingVo = new CashOutSettingVo(); |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.CASHOUT_SETTING.getType(), DataDictionaryEnum.CASHOUT_SETTING.getCode()); |
| | |
| | | MallMemberBank mallMemberBank = MallMemberBankConversion.INSTANCE.dtoToentity(addMemberBankDto); |
| | | mallMemberBank.setMemberId(member.getId()); |
| | | mallMemberBankMapper.insert(mallMemberBank); |
| | | return new FebsResponse().success(); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | Long id = updateMemberBankDto.getId(); |
| | | MallMemberBank mallMemberBank = mallMemberBankMapper.selectById(id); |
| | | mallMemberBank.setName(updateMemberBankDto.getName()); |
| | | mallMemberBank.setIdType(updateMemberBankDto.getIdType()); |
| | | mallMemberBank.setIdCardNum(updateMemberBankDto.getIdCardNum()); |
| | | mallMemberBank.setBankNo(updateMemberBankDto.getBankNo()); |
| | | mallMemberBank.setPhone(updateMemberBankDto.getPhone()); |
| | | mallMemberBank.setDigitalNo(updateMemberBankDto.getDigitalNo()); |
| | | mallMemberBank.setBankName(updateMemberBankDto.getBankName()); |
| | | mallMemberBank.setSubbranchName(updateMemberBankDto.getSubbranchName()); |
| | | mallMemberBank.setProvince(updateMemberBankDto.getProvince()); |
| | | mallMemberBank.setCity(updateMemberBankDto.getCity()); |
| | | mallMemberBank.setSkhh(updateMemberBankDto.getSkhh()); |
| | | mallMemberBankMapper.updateById(mallMemberBank); |
| | | return new FebsResponse().success(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public FebsResponse pwdForget(ForgetPwdDto forgetPwdDto) { |
| | | MallMember mallMember = this.baseMapper.selectInfoByAccountNew(forgetPwdDto.getAccountLogin(),forgetPwdDto.getPhone()); |
| | | MallMember mallMember = this.baseMapper.selectInfoByAccount(forgetPwdDto.getAccount()); |
| | | if(ObjectUtil.isEmpty(mallMember)){ |
| | | throw new FebsException("账号不存在"); |
| | | } |
| | |
| | | mallMember.setPassword(pwd); |
| | | |
| | | this.baseMapper.updateById(mallMember); |
| | | return new FebsResponse().success().message("重置成功"); |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | } |
| | |
| | | } |
| | | this.baseMapper.updateById(orderInfo); |
| | | |
| | | agentProducer.sendOrderCancelDelayMsg(orderInfo.getId(), 15 * 60 * 1000L); |
| | | return orderInfo.getId(); |
| | | } |
| | | |
| | |
| | | mallMqRecord.setRetryTimes(2); |
| | | mallMqRecord.setCreateTime(orderInfo.getPayTime()); |
| | | mallMqRecordMapper.insert(mallMqRecord); |
| | | //发送补贴消息 |
| | | agentProducer.sendPerkMoneyMsg(orderInfo.getId()); |
| | | //发送代理自动升级消息 |
| | | agentProducer.sendAutoLevelUpMsg(member.getId()); |
| | | break; |
| | | case "4": |
| | | if (orderInfo.getOrderType() != 2) { |
New file |
| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.FlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeNewEnum; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.*; |
| | | import cc.mrbird.febs.mall.conversion.CjInfoConversion; |
| | | import cc.mrbird.febs.mall.conversion.TzInfoConversion; |
| | | import cc.mrbird.febs.mall.dto.ApiCreateDto; |
| | | import cc.mrbird.febs.mall.dto.ApiCreateItemDto; |
| | | import cc.mrbird.febs.mall.dto.KjRecordDto; |
| | | import cc.mrbird.febs.mall.dto.OpenPrice; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.CJService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.vo.ApiKjInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiKjRecordVo; |
| | | import cc.mrbird.febs.mall.vo.ApiTzInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiTzListVo; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CJServiceImpl extends ServiceImpl<CjInfoMapper, CjInfo> implements CJService { |
| | | |
| | | private final KjRecordMapper kjRecordMapper; |
| | | private final RedisUtils redisUtils; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | private final AgentProducer agentProducer; |
| | | private final TzInfoMapper tzInfoMapper; |
| | | private final MallMemberWalletMapper mallMemberWalletMapper; |
| | | private final CjInfoMapper cjInfoMapper; |
| | | private final CjItemMapper cjItemMapper; |
| | | private final IApiMallMemberService mallMemberService; |
| | | |
| | | @Override |
| | | public FebsResponse kjRecord(KjRecordDto kjRecordDto) { |
| | | IPage<ApiKjRecordVo> page = new Page<>(kjRecordDto.getPageNum(), kjRecordDto.getPageSize()); |
| | | IPage<ApiKjRecordVo> pages = kjRecordMapper.selectListInPage(page, kjRecordDto); |
| | | return new FebsResponse().success().data(pages); |
| | | } |
| | | |
| | | @Override |
| | | public void createKjRecord() { |
| | | KjRecord kjRecord = new KjRecord(); |
| | | String kjNo = MallUtils.getOrderNum(); |
| | | kjRecord.setKjNo(kjNo); |
| | | kjRecordMapper.insert(kjRecord); |
| | | /** |
| | | * redis中设置下一期的开奖编号和开奖时间 |
| | | */ |
| | | //开奖编号 |
| | | String recordNoExit = redisUtils.getString(AppContants.KJ_RECORD_NO); |
| | | if (StrUtil.isNotBlank(recordNoExit)) { |
| | | redisUtils.del(AppContants.KJ_RECORD_NO); |
| | | } |
| | | redisUtils.set(AppContants.KJ_RECORD_NO, kjNo, 600); |
| | | //开奖时间 |
| | | if (StrUtil.isNotBlank(redisUtils.getString(AppContants.KJ_RECORD_TIME))) { |
| | | redisUtils.del(AppContants.KJ_RECORD_TIME); |
| | | } |
| | | redisUtils.set(AppContants.KJ_RECORD_TIME, kjRecord.getCreatedTime(), 600); |
| | | |
| | | agentProducer.sendChouJiangDelayMsg(kjNo, 10 * 60 * 1000L); |
| | | agentProducer.sendNoTimeDelayMsg(kjNo, 95 * 6 * 1000L);//提前三十秒停止下注 |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse kjInfo() { |
| | | ApiKjInfoVo apiKjInfoVo = new ApiKjInfoVo(); |
| | | String kjNoOld = redisUtils.getString(AppContants.KJ_RECORD_NO_OLD); |
| | | String kjNumOld = redisUtils.getString(AppContants.KJ_RECORD_NUM_OLD); |
| | | if(StrUtil.isBlank(kjNoOld)){ |
| | | KjRecord kjRecordOld = kjRecordMapper.selectOneByLimitZero(1,1); |
| | | if(ObjectUtil.isNotEmpty(kjRecordOld)){ |
| | | apiKjInfoVo.setKjNoOld(kjRecordOld.getKjNo()); |
| | | apiKjInfoVo.setKjNumOld(kjRecordOld.getKjNum()); |
| | | } |
| | | }else{ |
| | | apiKjInfoVo.setKjNoOld(kjNoOld); |
| | | apiKjInfoVo.setKjNumOld(kjNumOld); |
| | | } |
| | | |
| | | String kjNo = redisUtils.getString(AppContants.KJ_RECORD_NO); |
| | | String createdTime = redisUtils.getString(AppContants.KJ_RECORD_TIME); |
| | | if(StrUtil.isBlank(kjNo)){ |
| | | KjRecord kjRecord = kjRecordMapper.selectOneByLimitZero(0,1); |
| | | if(ObjectUtil.isNotEmpty(kjRecord)){ |
| | | apiKjInfoVo.setKjNo(kjRecord.getKjNo()); |
| | | apiKjInfoVo.setCreatedTime(kjRecord.getCreatedTime().toString()); |
| | | } |
| | | }else{ |
| | | apiKjInfoVo.setKjNo(kjNo); |
| | | try { |
| | | apiKjInfoVo.setCreatedTime(DateUtil.formatCstTime(createdTime, DateUtil.FULL_TIME_SPLIT_PATTERN)); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | DataDictionaryCustom timeIntervalDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.TIME_INTERVAL.getType(), |
| | | DataDictionaryEnum.TIME_INTERVAL.getCode() |
| | | ); |
| | | apiKjInfoVo.setDjs(Integer.parseInt(timeIntervalDic.getValue())); |
| | | return new FebsResponse().success().data(apiKjInfoVo); |
| | | } |
| | | |
| | | @Override |
| | | public void getChouJiangDelayMsg(String kjNo) { |
| | | //开启下注 |
| | | DataDictionaryCustom noTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.NO_TIME.getType(), |
| | | DataDictionaryEnum.NO_TIME.getCode() |
| | | ); |
| | | noTimeDic.setValue("1"); |
| | | dataDictionaryCustomMapper.updateById(noTimeDic); |
| | | //开奖 |
| | | KjRecord kjRecord = kjRecordMapper.selectKjNo(kjNo); |
| | | if(ObjectUtil.isEmpty(kjRecord)){ |
| | | return; |
| | | } |
| | | int randomInt = RandomUtil.randomInt(1, 25); |
| | | kjRecord.setKjNum( String.valueOf(randomInt)); |
| | | kjRecordMapper.updateById(kjRecord); |
| | | |
| | | //开奖编号 |
| | | String recordNoExit = redisUtils.getString(AppContants.KJ_RECORD_NO_OLD); |
| | | if (StrUtil.isNotBlank(recordNoExit)) { |
| | | redisUtils.del(AppContants.KJ_RECORD_NO_OLD); |
| | | } |
| | | redisUtils.set(AppContants.KJ_RECORD_NO_OLD, kjNo, 600); |
| | | |
| | | //开奖号码 |
| | | if (StrUtil.isNotBlank(redisUtils.getString(AppContants.KJ_RECORD_NUM_OLD))) { |
| | | redisUtils.del(AppContants.KJ_RECORD_NUM_OLD); |
| | | } |
| | | redisUtils.set(AppContants.KJ_RECORD_NUM_OLD, randomInt, 600); |
| | | OpenPrice openPrice = new OpenPrice(); |
| | | openPrice.setKjNo(kjNo); |
| | | openPrice.setKjNum(String.valueOf(randomInt)); |
| | | agentProducer.sendOpenPriceMsg(openPrice); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse tzInfo() { |
| | | ArrayList<ApiTzInfoVo> objects = new ArrayList<>(); |
| | | |
| | | List<TzInfo> tzInfos = tzInfoMapper.selectList(null); |
| | | if(CollUtil.isNotEmpty(tzInfos)){ |
| | | for(TzInfo tzInfo : tzInfos){ |
| | | ApiTzInfoVo apiTzInfoVo = TzInfoConversion.INSTANCE.entityToVo(tzInfo); |
| | | objects.add(apiTzInfoVo); |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(objects); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse create(ApiCreateDto apiCreateDto) { |
| | | // Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | Long memberId = 1L; |
| | | //开启下注 |
| | | DataDictionaryCustom noTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.NO_TIME.getType(), |
| | | DataDictionaryEnum.NO_TIME.getCode() |
| | | ); |
| | | if(noTimeDic.getValue().equals(2)){ |
| | | throw new FebsException("请等待下一期"); |
| | | } |
| | | |
| | | List<ApiCreateItemDto> items = apiCreateDto.getItems(); |
| | | if(CollUtil.isEmpty(items)){ |
| | | throw new FebsException("参数有误,请刷新页面"); |
| | | } |
| | | MallMemberWallet mallMemberWallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | BigDecimal totalAmount = BigDecimal.ZERO; |
| | | for(ApiCreateItemDto apiCreateItemDto : items){ |
| | | BigDecimal tzAmount = apiCreateItemDto.getTzAmount().setScale(2,BigDecimal.ROUND_DOWN);//投注金额 |
| | | if(BigDecimal.ZERO.compareTo(tzAmount) >= 0){ |
| | | throw new FebsException("金额必须大于0"); |
| | | } |
| | | totalAmount = totalAmount.add(tzAmount); |
| | | } |
| | | if(mallMemberWallet.getBalance().compareTo(totalAmount) < 0){ |
| | | throw new FebsException("余额不足"); |
| | | } |
| | | //新增一条投注主表记录 |
| | | CjInfo cjInfo = new CjInfo(); |
| | | cjInfo.setMemberId(memberId); |
| | | String kjNo = redisUtils.getString(AppContants.KJ_RECORD_NO); |
| | | cjInfo.setKjNo(kjNo); |
| | | cjInfo.setKjState(1); |
| | | cjInfo.setZjState(1); |
| | | cjInfo.setPerkAmount(BigDecimal.ZERO); |
| | | cjInfo.setTotalAmount(totalAmount); |
| | | cjInfoMapper.insert(cjInfo); |
| | | |
| | | for(ApiCreateItemDto apiCreateItemDto : items){ |
| | | Long id = apiCreateItemDto.getId();//投注ID |
| | | TzInfo tzInfo = tzInfoMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(tzInfo)){ |
| | | throw new FebsException("参数有误,请刷新页面"); |
| | | } |
| | | BigDecimal tzAmount = apiCreateItemDto.getTzAmount().setScale(2,BigDecimal.ROUND_DOWN);//投注金额 |
| | | totalAmount = totalAmount.add(tzAmount); |
| | | |
| | | CjItem cjItem = new CjItem(); |
| | | cjItem.setInfoId(cjInfo.getId()); |
| | | cjItem.setMemberId(memberId); |
| | | cjItem.setTzId(id); |
| | | cjItem.setType(tzInfo.getType()); |
| | | cjItem.setAmount(tzAmount); |
| | | cjItem.setItemNum(tzInfo.getTzCode()); |
| | | cjItem.setPerkAmount(BigDecimal.ZERO); |
| | | cjItemMapper.insert(cjItem); |
| | | } |
| | | |
| | | String orderNo = MallUtils.getOrderNum("T"); |
| | | mallMemberService.addMoneyFlow( |
| | | memberId, |
| | | totalAmount, |
| | | MoneyFlowTypeNewEnum.STATIC_BONUS.getValue(), |
| | | orderNo, |
| | | MoneyFlowTypeNewEnum.STATIC_BONUS.getDescription(), |
| | | null, |
| | | cjInfo.getId(), |
| | | 2, |
| | | FlowTypeEnum.BALANCE.getValue()); |
| | | |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse tzInfoList(KjRecordDto kjRecordDto) { |
| | | // Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | Long memberId = 1L; |
| | | kjRecordDto.setMemberId(memberId); |
| | | IPage<CjInfo> page = new Page<>(kjRecordDto.getPageNum(), kjRecordDto.getPageSize()); |
| | | IPage<CjInfo> pages = cjInfoMapper.selectTzListByMemberId(page, kjRecordDto); |
| | | List<CjInfo> records = pages.getRecords(); |
| | | List<ApiTzListVo> apiTzListVos = CjInfoConversion.INSTANCE.entitysToVos(records); |
| | | return new FebsResponse().success().data(apiTzListVos); |
| | | } |
| | | |
| | | @Override |
| | | public void getNoTimeDelayMsg(String kjNo) { |
| | | DataDictionaryCustom noTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.NO_TIME.getType(), |
| | | DataDictionaryEnum.NO_TIME.getCode() |
| | | ); |
| | | noTimeDic.setValue("2"); |
| | | dataDictionaryCustomMapper.updateById(noTimeDic); |
| | | } |
| | | |
| | | @Override |
| | | public void getOpenPriceMsg(String kjNo, String kjNum) { |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.FlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.GreenScoreEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | 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.LoginUserUtil; |
| | |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember mallMember = mallMemberService.getById(memberId); |
| | | |
| | | Integer outsideWith = mallMember.getOutsideWith() == null ? 2 :mallMember.getOutsideWith(); |
| | | if (1 != outsideWith) { |
| | | throw new FebsException("功能升级中"); |
| | | } |
| | | |
| | | if (StrUtil.isBlank(mallMember.getTradePassword())) { |
| | | throw new FebsException("未设置支付密码"); |
| | | } |
| | | |
| | | if (!mallMember.getTradePassword().equals(SecureUtil.md5(withdrawalDto.getTradePwd()))) { |
| | | throw new FebsException("支付密码错误"); |
| | | } |
| | | |
| | | CashOutSettingVo cashOutSettingVo = new CashOutSettingVo(); |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.CASHOUT_SETTING.getType(), DataDictionaryEnum.CASHOUT_SETTING.getCode()); |
| | | if (dic != null) { |
| | | cashOutSettingVo = JSONObject.parseObject(dic.getValue(), CashOutSettingVo.class); |
| | | } |
| | | |
| | | //每日提现额度上限 |
| | | BigDecimal allCashOut = cashOutSettingVo.getAllCashOut(); |
| | | if(withdrawalDto.getAmount().compareTo(allCashOut) > 0){ |
| | | throw new FebsException("每日限额为"+cashOutSettingVo.getAllCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | List<MallMemberWithdraw> mallMemberWithdrawListDone = this.baseMapper.selectListByMemberIdAndDate(memberId,new Date()); |
| | | if(CollUtil.isNotEmpty(mallMemberWithdrawListDone)){ |
| | | BigDecimal amountTCAll = mallMemberWithdrawListDone.stream().map(MallMemberWithdraw::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | amountTCAll = amountTCAll.add(withdrawalDto.getAmount()); |
| | | if (amountTCAll.compareTo(allCashOut) > 0) { |
| | | throw new FebsException("每日限额为"+cashOutSettingVo.getAllCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | } |
| | | |
| | | if (withdrawalDto.getAmount().compareTo(cashOutSettingVo.getMinCashOut()) < 0) { |
| | | throw new FebsException("最小提现金额为"+cashOutSettingVo.getMinCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | } |
| | | // //每日提现额度上限 |
| | | // BigDecimal allCashOut = cashOutSettingVo.getAllCashOut(); |
| | | // if(withdrawalDto.getAmount().compareTo(allCashOut) > 0){ |
| | | // throw new FebsException("每日限额为"+cashOutSettingVo.getAllCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | // } |
| | | // List<MallMemberWithdraw> mallMemberWithdrawListDone = this.baseMapper.selectListByMemberIdAndDate(memberId,new Date()); |
| | | // if(CollUtil.isNotEmpty(mallMemberWithdrawListDone)){ |
| | | // BigDecimal amountTCAll = mallMemberWithdrawListDone.stream().map(MallMemberWithdraw::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // amountTCAll = amountTCAll.add(withdrawalDto.getAmount()); |
| | | // if (amountTCAll.compareTo(allCashOut) > 0) { |
| | | // throw new FebsException("每日限额为"+cashOutSettingVo.getAllCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | // } |
| | | // } |
| | | // |
| | | // if (withdrawalDto.getAmount().compareTo(cashOutSettingVo.getMinCashOut()) < 0) { |
| | | // throw new FebsException("最小提现金额为"+cashOutSettingVo.getMinCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | // } |
| | | |
| | | MallMemberBank mallMemberBank = mallMemberBankMapper.selectById(withdrawalDto.getBankId()); |
| | | if(ObjectUtil.isEmpty(mallMemberBank)){ |
| | | throw new FebsException("未找到银行卡信息"); |
| | | } |
| | | if(ObjectUtil.isEmpty(mallMemberBank.getBankName())){ |
| | | throw new FebsException("请填写所属银行"); |
| | | } |
| | | if(ObjectUtil.isEmpty(mallMemberBank.getSubbranchName())){ |
| | | throw new FebsException("请填写所属支行"); |
| | | } |
| | | // if(ObjectUtil.isEmpty(mallMemberBank.getDigitalNo())){ |
| | | // throw new FebsException("请填写数字货币账号"); |
| | | // } |
| | | |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | // 可提现 |
| | | BigDecimal canMoney = wallet.getBalance(); |
| | | |
| | | if(withdrawalDto.getAmount().compareTo(canMoney) > 0) { |
| | | throw new FebsException("提现金额不足"); |
| | | throw new FebsException("金额不足"); |
| | | } |
| | | |
| | | BigDecimal serviceFeePercent = cashOutSettingVo.getServiceFee().multiply(BigDecimal.valueOf(0.01)); |
| | | BigDecimal serviceFee = serviceFeePercent.multiply(withdrawalDto.getAmount()); |
| | | String remark = AppContants.MEMBER_WITHDRAW_NORMAL; |
| | | DataDictionaryCustom voucherOnOffDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | GreenScoreEnum.VOUCHER_ON_OFF.getType(), |
| | | GreenScoreEnum.VOUCHER_ON_OFF.getCode() |
| | | ); |
| | | if(ObjectUtil.isNotEmpty(voucherOnOffDic)){ |
| | | String voucherOnOff = voucherOnOffDic.getValue(); |
| | | /** |
| | | * 绿色凭证提现开关 1:开启 2:关闭 |
| | | * 验证账户凭证数量 |
| | | * 不需要手续费 |
| | | * 减少用户的凭证数量 |
| | | */ |
| | | if("1".equals(voucherOnOff)){ |
| | | BigDecimal voucherCntDto = withdrawalDto.getVoucherCnt(); |
| | | if(voucherCntDto.compareTo(BigDecimal.ZERO) <= 0){ |
| | | throw new FebsException("能量不足"); |
| | | } |
| | | //提现需要的凭证数量 = 提现金额 * 余额提现需要绿色凭证比例 |
| | | DataDictionaryCustom voucherPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | GreenScoreEnum.VOUCHER_PERCENT.getType(), |
| | | GreenScoreEnum.VOUCHER_PERCENT.getCode() |
| | | ); |
| | | BigDecimal voucherPercent = new BigDecimal(voucherPercentDic.getValue() == null ? "0" : voucherPercentDic.getValue()).multiply(new BigDecimal(0.01)); |
| | | BigDecimal voucherPercentNeed = withdrawalDto.getAmount().multiply(voucherPercent).setScale(2,BigDecimal.ROUND_DOWN); |
| | | |
| | | DataDictionaryCustom scorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | GreenScoreEnum.SCORE_PRICE.getType(), |
| | | GreenScoreEnum.SCORE_PRICE.getCode()); |
| | | BigDecimal scorePrice = new BigDecimal(scorePriceDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN); |
| | | voucherPercentNeed = voucherPercentNeed.divide(scorePrice,2,BigDecimal.ROUND_DOWN); |
| | | |
| | | // BigDecimal voucherCnt = wallet.getVoucherCnt(); |
| | | BigDecimal voucherFireCnt = wallet.getVoucherFireCnt(); |
| | | if(voucherFireCnt.compareTo(voucherPercentNeed) < 0){ |
| | | throw new FebsException("能量不足"); |
| | | } |
| | | |
| | | // walletService.reduce(voucherCntDto, memberId, "voucherCnt"); |
| | | walletService.reduce(voucherCntDto, memberId, "voucherFireCnt"); |
| | | serviceFee = voucherCntDto; |
| | | remark = AppContants.MEMBER_WITHDRAW_VOUCHER; |
| | | } |
| | | } |
| | | |
| | | |
| | | walletService.reduce(withdrawalDto.getAmount(), memberId, "balance"); |
| | | String orderNo = MallUtils.getOrderNum("W"); |
| | | |
| | |
| | | withdraw.setAmount(withdrawalDto.getAmount()); |
| | | withdraw.setStatus(1); |
| | | withdraw.setAmountFee(serviceFee); |
| | | withdraw.setRemark(remark); |
| | | withdraw.setWtihdrawTypeId(mallMemberBank.getId()); |
| | | this.baseMapper.insert(withdraw); |
| | | |
| | | mallMemberService.addMoneyFlow(memberId, withdrawalDto.getAmount().negate(), MoneyFlowTypeEnum.WITHDRAWAL.getValue(), orderNo, null, null, null, 1, FlowTypeEnum.BALANCE.getValue()); |
| | | mallMemberService.addMoneyFlow( |
| | | memberId, |
| | | withdrawalDto.getAmount().negate(), |
| | | MoneyFlowTypeNewEnum.RANK_BONUS.getValue(), |
| | | orderNo, |
| | | MoneyFlowTypeNewEnum.RANK_BONUS.getDescription(), |
| | | null, |
| | | null, |
| | | 1, |
| | | FlowTypeEnum.BALANCE.getValue()); |
| | | } |
| | | } |
| | |
| | | throw new FebsException("未设置支付密码"); |
| | | } |
| | | |
| | | if (!mallMember.getTradePassword().equals(SecureUtil.md5(withdrawalDto.getTradePwd()))) { |
| | | throw new FebsException("支付密码错误"); |
| | | } |
| | | |
| | | CashOutSettingVo cashOutSettingVo = new CashOutSettingVo(); |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.CASHOUT_SETTING.getType(), DataDictionaryEnum.CASHOUT_SETTING.getCode()); |
| | | if (dic != null) { |
| | |
| | | |
| | | private BigDecimal amount; |
| | | |
| | | private Integer type; |
| | | |
| | | private Integer flowType; |
| | | |
| | | private String orderNo; |
| | | |
| | | private String description; |
| | | |
| | | private String remark; |
| | | /** |
| | | * 来源 |
| | | */ |
| | | private String fromMemberName; |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiKjInfoVo", description = "首页头部信息") |
| | | public class ApiKjInfoVo { |
| | | @ApiModelProperty(value = "上一期期号") |
| | | private String kjNoOld;//开奖编号 |
| | | @ApiModelProperty(value = "上一期开奖号码") |
| | | private String kjNumOld;//开奖数字 |
| | | @ApiModelProperty(value = "期号") |
| | | private String kjNo;//开奖编号 |
| | | @ApiModelProperty(value = "倒计时开始时间") |
| | | private String createdTime; |
| | | @ApiModelProperty(value = "倒计时(分钟)") |
| | | private Integer djs;//开奖数字 |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiKjRecordVo", description = "历史开奖记录") |
| | | public class ApiKjRecordVo { |
| | | @ApiModelProperty(value = "期号") |
| | | private String kjNo;//开奖编号 |
| | | @ApiModelProperty(value = "开奖号码 null-代表未开奖") |
| | | private String kjNum;//开奖数字 |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiTzInfoVo", description = "首页信息") |
| | | public class ApiTzInfoVo { |
| | | |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id;//类型 1-按大小 2-按单双 3-按数字 |
| | | |
| | | @ApiModelProperty(value = "类型 1-按大小 2-按单双 3-按数字") |
| | | private Integer type;//类型 1-按大小 2-按单双 3-按数字 |
| | | |
| | | @ApiModelProperty(value = "值") |
| | | private String tzCode;//值 |
| | | |
| | | @ApiModelProperty(value = "获奖倍率") |
| | | private BigDecimal tzPercent;//获奖倍率 |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiTzItemVos", description = "投注列表") |
| | | public class ApiTzItemVos { |
| | | |
| | | @ApiModelProperty(value = "投注类型 1-按大小 2-按单双 3-按数字") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "投入金额") |
| | | private BigDecimal amount;//投入金额 |
| | | @ApiModelProperty(value = "投注数字") |
| | | private String itemNum;//投注数字 |
| | | @ApiModelProperty(value = "中奖号码") |
| | | private String kjNum;//中奖号码 |
| | | @ApiModelProperty(value = "中奖金额") |
| | | private BigDecimal perkAmount;//中奖金额 |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiTzListVo", description = "投注列表") |
| | | public class ApiTzListVo { |
| | | |
| | | @ApiModelProperty(value = "开奖编号") |
| | | private String kjNo; |
| | | @ApiModelProperty(value = "时间") |
| | | private Date createdTime; |
| | | @ApiModelProperty(value = "开奖号码") |
| | | private String kjNum;//开奖数字 |
| | | @ApiModelProperty(value = "投注总金额") |
| | | private BigDecimal totalAmount;//投注总金额 |
| | | @ApiModelProperty(value = "中奖总金额") |
| | | private BigDecimal perkAmount;//投注总金额 |
| | | @ApiModelProperty(value = "详情") |
| | | private List<ApiTzItemVos> items;//投注总金额 |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "登录账号") |
| | | private String accountLogin; |
| | | |
| | | @ApiModelProperty(value = "昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @ApiModelProperty(value = "账号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "邮箱") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | |
| | | @ApiModelProperty(value = "邀请码") |
| | | private String inviteId; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty(value = "余额") |
| | | private BigDecimal balance; |
| | | |
| | | @ApiModelProperty(value = "代理等级") |
| | | private String levelName; |
| | | |
| | | @ApiModelProperty(value = "推荐人昵称") |
| | | private String referrerName; |
| | | |
| | | private String level; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createdTime; |
| | | |
| | | /** |
| | | * 账户状态;1-正常 2-禁用 |
| | |
| | | private Integer accountStatus; |
| | | public static final int ACCOUNTSTATUS_Y = 1; |
| | | public static final int ACCOUNTSTATUS_N = 2; |
| | | |
| | | @ApiModelProperty(value = "是否设置收款方式", example = "1是2否") |
| | | private Integer hasPayment = 2; |
| | | |
| | | @ApiModelProperty(value = "是否设置交易密码", example = "1是2否") |
| | | private Integer hasTradePwd = 2; |
| | | |
| | | @ApiModelProperty(value = "绑定手机号") |
| | | private String bindPhone; |
| | | |
| | | @ApiModelProperty(value = "累计消费") |
| | | private BigDecimal totalCost; |
| | | |
| | | @ApiModelProperty(value = "赠送积分") |
| | | private BigDecimal score; |
| | | |
| | | @ApiModelProperty(value = "抽奖积分") |
| | | private BigDecimal prizeScore; |
| | | |
| | | /** |
| | | * 董事 |
| | | */ |
| | | @ApiModelProperty(value = "是否为董事 1-是 2-否") |
| | | private Integer director; |
| | | |
| | | /** |
| | | * 店长 |
| | | */ |
| | | @ApiModelProperty(value = "是否店长 1-是 2-否") |
| | | private Integer storeMaster; |
| | | |
| | | @ApiModelProperty(value = "补贴额度") |
| | | private BigDecimal totalScore; |
| | | |
| | | @ApiModelProperty(value = "贡献点") |
| | | private Integer star; |
| | | |
| | | @ApiModelProperty(value = "凭证数量") |
| | | private BigDecimal voucherCnt; |
| | | |
| | | @ApiModelProperty(value = "内转标识 1:开启 2:关闭") |
| | | private Integer insideWith; |
| | | |
| | | } |
| | |
| | | @ApiModel(value = "MemberBankListVo", description = "信息返回类") |
| | | public class MemberBankListVo { |
| | | private Long id; |
| | | // 姓名 |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | //证件类型 |
| | | @ApiModelProperty(value = "证件类型") |
| | | private String idType; |
| | | //证件号码 |
| | | @ApiModelProperty(value = "证件号码") |
| | | @ApiModelProperty(value = "身份证") |
| | | private String idCardNum; |
| | | // 银行卡号 |
| | | @ApiModelProperty(value = "银行卡号") |
| | | @ApiModelProperty(value = "卡号") |
| | | private String bankNo; |
| | | // 手机号 |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | // 银行卡号 |
| | | @ApiModelProperty(value = "数字账号") |
| | | private String digitalNo; |
| | | // 开户行 |
| | | @ApiModelProperty(value = "开户行") |
| | | private String bankName; |
| | | |
| | | @ApiModelProperty(value = "支行") |
| | | private String subbranchName; |
| | | // 省 |
| | | @ApiModelProperty(value = "省") |
| | | private String province; |
| | | // 市 |
| | | @ApiModelProperty(value = "市") |
| | | private String city; |
| | | // 收款行号 |
| | | @ApiModelProperty(value = "收款行号") |
| | | private String skhh; |
| | | } |
| | |
| | | @ApiModelProperty(value = "金额,有正负") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value = "类型 1-静态收益 2-直推奖 3-代理收益 4-排名收益 5-总监收益 6-社区点补 7-一代收益 8-提现 9-转增 10-支付 11-退款") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "类型 1-静态收益 2-直推奖 3-代理收益 4-排名收益 5-总监收益 6-社区点补 7-一代收益 8-提现 9-转增 10-支付 11-退款") |
| | | private Integer flowType; |
| | | |
| | | @ApiModelProperty(value = "对方手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "代理等级") |
| | | private String memberLevel; |
| | | |
| | | @ApiModelProperty(value = "提现状态 1-提现中2-成功 3-拒绝") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "描述") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createdTime; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | mallMoneyFlowService.addMoneyFlow(mallMember.getId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue()); |
| | | agentProducer.sendAutoLevelUpMsg(mallMember.getId()); |
| | | agentProducer.sendOrderReturn(orderInfo.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | mallMoneyFlowService.addMoneyFlow(mallMember.getId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue()); |
| | | agentProducer.sendAutoLevelUpMsg(mallMember.getId()); |
| | | agentProducer.sendOrderReturn(orderInfo.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | orderInfoMapper.updateById(orderInfo); |
| | | |
| | | // agentProducer.sendReturnMoneyMsg(orderInfo.getId()); |
| | | agentProducer.sendAutoLevelUpMsg(orderInfo.getMemberId()); |
| | | |
| | | // memberService.addMoneyFlow(orderInfo.getMemberId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), null, null, null, null, FlowTypeEnum.BALANCE.getValue()); |
| | | } |
| | |
| | | mallMqRecord.setState(2); |
| | | mallMqRecord.setRetryTimes(2); |
| | | mallMqRecordMapper.insert(mallMqRecord); |
| | | //发送补贴消息 |
| | | agentProducer.sendPerkMoneyMsg(orderInfo.getId()); |
| | | //发送代理自动升级消息 |
| | | agentProducer.sendAutoLevelUpMsg(orderInfo.getMemberId()); |
| | | |
| | | return "SUCCESS"; |
| | | }else{ |
| | | return "FAIL"; |
| | |
| | | mallMqRecord.setState(2); |
| | | mallMqRecord.setRetryTimes(2); |
| | | mallMqRecordMapper.insert(mallMqRecord); |
| | | //发送补贴消息 |
| | | agentProducer.sendPerkMoneyMsg(orderInfo.getId()); |
| | | //发送代理自动升级消息 |
| | | agentProducer.sendAutoLevelUpMsg(orderInfo.getMemberId()); |
| | | } |
| | | } |
| | |
| | | **/ |
| | | public class QueueConstants { |
| | | |
| | | public static final String QUEUE_DEFAULT = "hlm_queue_default"; |
| | | public static final String AGENT_AUTO_LEVEL_UP = "hlm_queue_agent_auto_level_up"; |
| | | public static final String AGENT_RETURN_MONEY = "hlm_queue_agent_return_money"; |
| | | public static final String ORDER_RETURN_MONEY = "hlm_queue_order_return_money"; |
| | | public static final String QUEUE_OPEN_PRICE = "queue_open_price"; |
| | | /** |
| | | * 补贴金额 , |
| | | * 分享补贴,星级补贴 |
| | | * 延时 |
| | | */ |
| | | public static final String PERK_MONEY = "hlm_queue_perk_money"; |
| | | public static final String QUEUE_NO_TIME = "queue_no_time"; |
| | | public static final String QUEUE_NO_TIME_TTL = "queue_no_time_ttl"; |
| | | |
| | | public static final String FORCE_VOUCHER_SALE = "hlm_queue_force_voucher_sale"; |
| | | /** |
| | | * 延时 |
| | | */ |
| | | public static final String QUEUE_CHOU_JIANG_TIME = "queue_chou_jiang_time"; |
| | | public static final String QUEUE_CHOU_JIANG_TIME_TTL = "queue_chou_jiang_time_ttl"; |
| | | } |
| | |
| | | package cc.mrbird.febs.rabbit.consumer; |
| | | |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.mall.service.IApiMallOrderInfoService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.mall.dto.OpenPrice; |
| | | import cc.mrbird.febs.mall.service.CJService; |
| | | import cc.mrbird.febs.rabbit.constants.QueueConstants; |
| | | import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum; |
| | | import com.rabbitmq.client.Channel; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.core.Message; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | public class AgentConsumer { |
| | | |
| | | @Autowired |
| | | private IApiMallOrderInfoService orderInfoService; |
| | | @Autowired |
| | | private IAgentService agentService; |
| | | @Autowired |
| | | private IMemberProfitService memberProfitService; |
| | | private CJService cjService; |
| | | |
| | | @RabbitListener(queues = QueueConstants.QUEUE_DEFAULT) |
| | | public void agentReturn(Message message, Channel channel) { |
| | | log.info("消费者:{}", new String(message.getBody())); |
| | | } |
| | | @RabbitListener(queues = QueueConstants.QUEUE_CHOU_JIANG_TIME) |
| | | public void getChouJiangDelayMsg(String kjNo) { |
| | | |
| | | @RabbitListener(queues = "hlm_queue_order_delay") |
| | | public void orderCancelDelay(String id) { |
| | | log.info("收到延时开奖信息消息,编号:{}",kjNo); |
| | | try { |
| | | orderInfoService.autoCancelOrder(Long.parseLong(id)); |
| | | cjService.getChouJiangDelayMsg(kjNo); |
| | | } catch (Exception e) { |
| | | log.error("订单超时支付异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.AGENT_AUTO_LEVEL_UP) |
| | | public void agentAutoLevelUp(String id) { |
| | | log.info("收到合伙人自动升级消息:{}", id); |
| | | try { |
| | | agentService.autoUpAgentLevel(Long.parseLong(id)); |
| | | } catch (Exception e) { |
| | | log.error("合伙人自动升级异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.AGENT_RETURN_MONEY) |
| | | public void agentReturnMoney(String orderId) { |
| | | log.info("收到返利消息:{}", orderId); |
| | | try { |
| | | agentService.returnMoneyToAgent(Long.parseLong(orderId)); |
| | | } catch (Exception e) { |
| | | log.error("返利异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.ORDER_RETURN_MONEY) |
| | | public void orderReturnMoney(String orderId) { |
| | | log.info("收到订单返利消息:{}", orderId); |
| | | try { |
| | | memberProfitService.dynamicProfit(Long.parseLong(orderId)); |
| | | } catch (Exception e) { |
| | | log.error("订单返利异常:", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.PERK_MONEY) |
| | | public void perkMoneyConsumer(String id) { |
| | | log.info("收到补贴消息:{}", id); |
| | | try { |
| | | agentService.perkMoneyConsumer(Long.parseLong(id)); |
| | | } catch (Exception e) { |
| | | log.error("用户补贴异常", e); |
| | | log.error("延时开奖异常", e); |
| | | // todo 更新表 |
| | | |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.FORCE_VOUCHER_SALE) |
| | | public void forceVoucherSaleConsumer(String price) { |
| | | log.info("收到强制卖出消息,价格:{}",price); |
| | | @RabbitListener(queues = QueueConstants.QUEUE_NO_TIME) |
| | | public void getNoTimeDelayMsg(String kjNo) { |
| | | log.info("收到停止下注消息,编号:{}",kjNo); |
| | | try { |
| | | memberProfitService.selaHalfVoucher(price); |
| | | cjService.getNoTimeDelayMsg(kjNo); |
| | | } catch (Exception e) { |
| | | log.error("强制卖出异常", e); |
| | | log.error("停止下注异常", e); |
| | | // todo 更新表 |
| | | |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.QUEUE_OPEN_PRICE) |
| | | public void getOpenPriceMsg(OpenPrice openPrice) { |
| | | log.info("收到开奖信息:{}, {}", openPrice.getKjNo(), openPrice.getKjNum()); |
| | | try { |
| | | cjService.getOpenPriceMsg(openPrice.getKjNo(), openPrice.getKjNum()); |
| | | } catch (Exception e) { |
| | | log.error("开奖信息异常", e); |
| | | // todo 更新表 |
| | | |
| | | } |
| | |
| | | package cc.mrbird.febs.rabbit.enumerates; |
| | | |
| | | import cc.mrbird.febs.rabbit.constants.QueueConstants; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | public enum RabbitQueueEnum { |
| | | |
| | | DEFAULT("hlm_exchange_default", |
| | | "hlm_route_key_default", |
| | | "hlm_queue_default"), |
| | | |
| | | ORDER_CANCEL_DELAY_TTL("hlm_exchange_order_delay_ttl", |
| | | "hlm_route_key_order_delay_ttl", |
| | | "hlm_queue_order_delay_ttl"), |
| | | ORDER_CANCEL_DELAY("hlm_exchange_order_delay", |
| | | "hlm_route_key_order_delay", |
| | | "hlm_queue_order_delay"), |
| | | |
| | | AGENT_REUTRN_MONEY("hlm_exchange_agent_return_money", |
| | | "hlm_route_key_agent_return_money", |
| | | "hlm_queue_agent_return_money"), |
| | | |
| | | ORDER_RETURN_MONEY("hlm_exchange_order_return_money", |
| | | "hlm_route_key_order_return_money", |
| | | "hlm_queue_order_return_money"), |
| | | |
| | | PERK_MONEY("hlm_exchange_perk_money", |
| | | "hlm_route_key_perk_money", |
| | | "hlm_queue_perk_money"), |
| | | |
| | | FORCE_VOUCHER_SALE("hlm_exchange_force_voucher_sale", |
| | | "hlm_route_key_force_voucher_sale", |
| | | "hlm_queue_force_voucher_sale"); |
| | | OPEN_PRICE("exchange_open_price", |
| | | "route_key_open_price", |
| | | QueueConstants.QUEUE_OPEN_PRICE), |
| | | /** |
| | | * 延时不允许下注 |
| | | */ |
| | | NO_TIME("exchange_no_time", |
| | | "route_key_no_time", |
| | | QueueConstants.QUEUE_NO_TIME), |
| | | NO_TIME_TTL("exchange_no_time_ttl", |
| | | "route_key_no_time_ttl", |
| | | QueueConstants.QUEUE_NO_TIME_TTL), |
| | | /** |
| | | * 延时 |
| | | */ |
| | | CHOU_JIANG_TIME("exchange_chou_jiang_time", |
| | | "route_key_chou_jiang_time", |
| | | QueueConstants.QUEUE_CHOU_JIANG_TIME), |
| | | CHOU_JIANG_TIME_TTL("exchange_chou_jiang_time_ttl", |
| | | "route_key_chou_jiang_time_ttl", |
| | | QueueConstants.QUEUE_CHOU_JIANG_TIME_TTL); |
| | | |
| | | private String exchange; |
| | | |
| | |
| | | package cc.mrbird.febs.rabbit.producter; |
| | | |
| | | import cc.mrbird.febs.mall.dto.OpenPrice; |
| | | import cc.mrbird.febs.rabbit.constants.ExchangeConstants; |
| | | import cc.mrbird.febs.rabbit.constants.RouteKeyConstants; |
| | | import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.AmqpException; |
| | | import org.springframework.amqp.core.Message; |
| | |
| | | |
| | | } |
| | | |
| | | public void sendOrderReturn(Long id) { |
| | | log.info("发送消息:{}", id); |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.ORDER_RETURN_MONEY.getExchange(), RabbitQueueEnum.ORDER_RETURN_MONEY.getRoute(), id, correlationData); |
| | | } |
| | | |
| | | public void sendOrderCancelDelayMsg(Long id, Long times) { |
| | | log.info("发送自动取消订单消息:{}, {}", id, times); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.ORDER_CANCEL_DELAY_TTL.getExchange(), RabbitQueueEnum.ORDER_CANCEL_DELAY_TTL.getRoute(), id, new MessagePostProcessor() { |
| | | public void sendChouJiangDelayMsg(String id, Long times) { |
| | | log.info("发送延时开奖信息消息:{}, {}", id, times); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.CHOU_JIANG_TIME_TTL.getExchange(), |
| | | RabbitQueueEnum.CHOU_JIANG_TIME_TTL.getRoute(), |
| | | id, new MessagePostProcessor() { |
| | | @Override |
| | | public Message postProcessMessage(Message message) throws AmqpException { |
| | | message.getMessageProperties().setExpiration(String.valueOf(times)); |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 发送代理自动升级消息 |
| | | * |
| | | * @param memberId |
| | | */ |
| | | public void sendAutoLevelUpMsg(@NotNull Long memberId) { |
| | | log.info("发送代理自动升级消息:{}", memberId); |
| | | rabbitTemplate.convertAndSend(ExchangeConstants.EXCHANGE_DEFAULT, RouteKeyConstants.ROUTE_KEY_DEFAULT, memberId); |
| | | public void sendNoTimeDelayMsg(String id, Long times) { |
| | | log.info("发送停止下注:{}, {}", id, times); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.NO_TIME_TTL.getExchange(), |
| | | RabbitQueueEnum.NO_TIME_TTL.getRoute(), |
| | | id, new MessagePostProcessor() { |
| | | @Override |
| | | public Message postProcessMessage(Message message) throws AmqpException { |
| | | message.getMessageProperties().setExpiration(String.valueOf(times)); |
| | | return message; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public void sendReturnMoneyMsg(Long orderId) { |
| | | log.info("发送返利消息:{}", orderId); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.AGENT_REUTRN_MONEY.getExchange(), RabbitQueueEnum.AGENT_REUTRN_MONEY.getRoute(), orderId); |
| | | } |
| | | |
| | | public void sendPerkMoneyMsg(Long orderId) { |
| | | log.info("发送补贴消息:{}", orderId); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.PERK_MONEY.getExchange(), RabbitQueueEnum.PERK_MONEY.getRoute(), orderId); |
| | | } |
| | | |
| | | public void sendForceVoucherSaleMsg(String value) { |
| | | log.info("发送强制卖出消息,价格:{}",value); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.FORCE_VOUCHER_SALE.getExchange(), RabbitQueueEnum.FORCE_VOUCHER_SALE.getRoute(),value); |
| | | public void sendOpenPriceMsg(OpenPrice openPrice) { |
| | | log.info("发送开奖信息:{}, {}", openPrice.getKjNo(), openPrice.getKjNum()); |
| | | CorrelationData correlationData = new CorrelationData(IdUtil.simpleUUID()); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.OPEN_PRICE.getExchange(), |
| | | RabbitQueueEnum.OPEN_PRICE.getRoute(), openPrice, correlationData); |
| | | } |
| | | } |
| | |
| | | datasource: |
| | | # 数据源-1,名称为 base |
| | | base: |
| | | username: ct_test |
| | | password: 123456 |
| | | username: root |
| | | password: root |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://120.27.238.55:3406/db_hongloumeng?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://127.0.0.1:3306/db_hongloumeng?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2b8 |
| | | |
| | | redis: |
| | | # Redis数据库索引(默认为 0) |
New file |
| | |
| | | <?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="cc.mrbird.febs.mall.mapper.CjInfoMapper"> |
| | | |
| | | <resultMap id="CjInfoMap" type="cc.mrbird.febs.mall.entity.CjInfo"> |
| | | <id column="id" property="id" /> |
| | | <result column="total_amount" property="totalAmount" /> |
| | | <result column="kj_num" property="kjNum" /> |
| | | <result column="kj_no" property="kjNo" /> |
| | | <result column="kj_state" property="kjState" /> |
| | | <result column="zj_state" property="zjState" /> |
| | | <result column="perk_amount" property="perkAmount" /> |
| | | <result column="CREATED_TIME" property="createdTime" /> |
| | | <collection property="items" ofType="cc.mrbird.febs.mall.entity.CjItem"> |
| | | <id column="item_id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="amount" property="amount" /> |
| | | <result column="item_kj_num" property="kjNum" /> |
| | | <result column="item_num" property="itemNum" /> |
| | | <result column="item_perk_amount" property="perkAmount" /> |
| | | <result column="item_CREATED_TIME" property="createdTime" /> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <select id="selectTzListByMemberId" resultMap="CjInfoMap"> |
| | | select |
| | | a.*, |
| | | b.id item_id, |
| | | b.type, |
| | | b.amount, |
| | | b.item_num, |
| | | b.kj_num item_kj_num, |
| | | b.CREATED_TIME item_CREATED_TIME, |
| | | b.perk_amount item_perk_amount |
| | | from cj_info a |
| | | inner join cj_item b on a.id = b.info_id |
| | | <where> |
| | | <if test="record.memberId != null"> |
| | | and a.member_id=#{record.memberId} |
| | | </if> |
| | | </where> |
| | | order by a.created_time desc |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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="cc.mrbird.febs.mall.mapper.KjRecordMapper"> |
| | | |
| | | <!-- <select id="selectAchieveTotal" resultType="java.math.BigDecimal">--> |
| | | <!-- select IFNULL(sum(IFNULL(amount,0)),0) from mall_achieve_record--> |
| | | <!-- where 1=1--> |
| | | <!-- <if test='type == "D"'>--> |
| | | <!-- and date_format(achieve_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d');--> |
| | | <!-- </if>--> |
| | | <!-- <if test='type == "M"'>--> |
| | | <!-- and date_format(achieve_time, '%Y-%m') = date_format(#{date}, '%Y-%m');--> |
| | | <!-- </if>--> |
| | | <!-- </select>--> |
| | | |
| | | <!-- <select id="selectSumAchieveByMemberIds" resultType="java.math.BigDecimal">--> |
| | | <!-- select IFNULL(sum(IFNULL(amount,0)),0)--> |
| | | <!-- from mall_achieve_record--> |
| | | <!-- where member_id IN--> |
| | | <!-- <foreach collection = "list" item = "item" separator="," open = "(" close = ")" >--> |
| | | <!-- #{item}--> |
| | | <!-- </foreach >--> |
| | | <!-- and date_format(achieve_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d');--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="selectListInPage" resultType="cc.mrbird.febs.mall.vo.ApiKjRecordVo"> |
| | | select * |
| | | from kj_record |
| | | order by CREATED_TIME desc ; |
| | | </select> |
| | | |
| | | <select id="selectOneByLimitZero" resultType="cc.mrbird.febs.mall.entity.KjRecord"> |
| | | select * |
| | | from kj_record |
| | | ORDER BY CREATED_TIME DESC |
| | | limit #{limitFrom},#{limitSize}; |
| | | </select> |
| | | |
| | | <select id="selectKjNo" resultType="cc.mrbird.febs.mall.entity.KjRecord"> |
| | | select * |
| | | from kj_record |
| | | where kj_no = #{kjNo}; |
| | | </select> |
| | | |
| | | <!-- <select id="selectSumAchieveByMemberId" resultType="java.math.BigDecimal">--> |
| | | <!-- select IFNULL(sum(IFNULL(amount,0)),0)--> |
| | | <!-- from mall_achieve_record--> |
| | | <!-- where member_id = #{memberId};--> |
| | | <!-- </select>--> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="selectInfoByAccount" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member where phone=#{account} or email=#{account} or invite_id=#{account} |
| | | select * from mall_member where phone = #{account} or email = #{account} or invite_id=#{account} |
| | | </select> |
| | | |
| | | <select id="selectInfoByAccountNew" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | |
| | | |
| | | <select id="selectMoneyFlowInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallMoneyFlowVo"> |
| | | select |
| | | a.*, |
| | | b.name fromMemberName |
| | | a.* |
| | | from mall_money_flow a |
| | | left join mall_member b on a.rt_member_id = b.id |
| | | where a.member_id = #{record.id} |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectApiMoneyFlowInPage" resultType="cc.mrbird.febs.mall.vo.MoneyFlowVo"> |
| | | select |
| | | a.*, |
| | | case when a.rt_member_id is null then (select n.phone from mall_member n where n.id=a.member_id) |
| | | when a.rt_member_id is not null then (select m.phone from mall_member m where m.id=a.rt_member_id) |
| | | end phone, |
| | | c.description memberLevel |
| | | a.* |
| | | from mall_money_flow a |
| | | left join mall_member b on a.rt_member_id=b.id |
| | | left join data_dictionary_custom c on b.level = c.code and c.type='AGENT_LEVEL' |
| | | <where> |
| | | <if test="record.inOrOut == 3"> |
| | | and a.amount > 0 |
| | | </if> |
| | | <if test="record.inOrOut == 2"> |
| | | and 0 > a.amount |
| | | </if> |
| | | <if test="record.memberId != null"> |
| | | and a.member_id=#{record.memberId} |
| | | </if> |
| | | <if test="record.flowType != null and record.flowType != ''"> |
| | | and a.flow_type=#{record.flowType} |
| | | </if> |
| | | <if test="record.type != null and record.type != ''"> |
| | | and a.type=#{record.type} |
| | | </if> |
| | | </where> |
| | | where a.member_id=#{record.memberId} |
| | | order by a.created_time desc |
| | | </select> |
| | | |
| | |
| | | <input type="text" name="name" lay-verify="required" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">推荐人:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="inviteId" lay-verify="required" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="member-add-form-submit" id="submit"></button> |
| | | </div> |
| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">登录账户:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="登录账户" name="accountLogin" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="名称" name="name" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">账号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号码/邀请码" name="account" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">账户状态:</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="accountStatus"> |
| | | <option value="">请选择</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">禁用</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">会员类型:</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="level"> |
| | | <option value="">请选择</option> |
| | | <option value="ZERO_LEVEL">普通会员</option> |
| | | <option value="SECOND_LEVEL">1星</option> |
| | | <option value="THIRD_LEVEL">2星</option> |
| | | <option value="FOUR_LEVEL">3星</option> |
| | | <option value="FIFTH_LEVEL">4星</option> |
| | | <option value="SIX_LEVEL">5星</option> |
| | | <option value="SEVEN_LEVEL">6星</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">账户状态:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select name="accountStatus">--> |
| | | <!-- <option value="">请选择</option>--> |
| | | <!-- <option value="1">正常</option>--> |
| | | <!-- <option value="2">禁用</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | |
| | | <!-- 表格操作栏 start --> |
| | | <script type="text/html" id="mallmember-option"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="moneyFlow:update" lay-event="moneyFlow">资金流水</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="updateReferer:update" lay-event="updateReferer">修改推荐人</button> |
| | | </script> |
| | | <script type="text/html" id="switchStatus"> |
| | | {{# if(d.accountStatus === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" checked lay-skin="switch" lay-filter="switchStatus"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="正常|禁用" lay-skin="switch" lay-filter="switchStatus"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchStoreMaster"> |
| | | {{# if(d.storeMaster === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchStoreMaster"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchStoreMaster"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchDirector"> |
| | | {{# if(d.director === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchDirector"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchDirector"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchCreate"> |
| | | {{# if(d.creater === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchCreate"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchCreate"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchPartner"> |
| | | {{# if(d.partner === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchPartner"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchInsideWith"> |
| | | {{# if(d.insideWith === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchInsideWith"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchInsideWith"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchOutsideWith"> |
| | | {{# if(d.outsideWith === 1) { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchOutsideWith"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.id}} lay-text="是|否" lay-skin="switch" lay-filter="switchOutsideWith"> |
| | | {{# } }} |
| | | </script> |
| | | <style> |
| | |
| | | </style> |
| | | <script type="text/html" id="tableMemberBar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" lay-event="exportMember">导出会员信息</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="addMember:update" lay-event="registMember">添加会员</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="mallSystemPay:update" lay-event="balance">拨付余额</button> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="mallSystemPay:update" lay-event="score">拨付赠送积分</button>--> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="mallSystemPay:update" lay-event="prizeScore">拨付现金积分</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="resetPwd:update" lay-event="resetPwd">重置登录密码</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="resetPwd:update" lay-event="resetPayPwd">重置支付密码</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="agentLevelSet:update" lay-event="agentLevel">设置代理等级</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="voucherUpdate:update" lay-event="voucherUpdate">拨付绿色凭证</button> |
| | | </div> |
| | | </script> |
| | | <!-- 表格操作栏 end --> |
| | |
| | | let toolbarMallmember = $.trim($("#mallmember-option").html())==="" ? true : false; |
| | | // alert($.trim($("#mallmember-option").html())); |
| | | form.render(); |
| | | let currPageGoods = 1;//首先默认值为1,防止出错 |
| | | let currPageMember = 1;//首先默认值为1,防止出错 |
| | | //获取当前页 |
| | | currPageGoods = $view.find(".layui-laypage-em").next().html(); |
| | | currPageMember = $view.find(".layui-laypage-em").next().html(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'see') { |
| | | febs.modal.open( '个人信息', 'modules/mallMember/detail/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'moneyFlow') { |
| | | febs.modal.open( '用户资金流水', 'modules/mallMember/moneyFlow/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |
| | | |
| | | if (layEvent == 'updateReferer') { |
| | | febs.modal.open( '修改推荐人', 'modules/mallMember/updateReferer/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#referer-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | function outsideWithYes(id) { |
| | | febs.get(ctx + 'admin/mallMember/outsideWithYes/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function outsideWithNo(id) { |
| | | febs.get(ctx + 'admin/mallMember/outsideWithNo/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function insideWithYes(id) { |
| | | febs.get(ctx + 'admin/mallMember/insideWithYes/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function insideWithNo(id) { |
| | | febs.get(ctx + 'admin/mallMember/insideWithNo/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function closeAccount(id) { |
| | | febs.get(ctx + 'admin/mallMember/closeAccount/' + id, null, function () { |
| | | febs.alert.success('禁用成功'); |
| | |
| | | function openAccount(id) { |
| | | febs.get(ctx + 'admin/mallMember/openAccount/' + id, null, function () { |
| | | febs.alert.success('开启成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | function changeIdentityYes(type, id) { |
| | | febs.get(ctx + 'admin/mallMember/changeIdentityYes/' + type + "/" + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function changeIdentityNo(type, id) { |
| | | febs.get(ctx + 'admin/mallMember/changeIdentityNo/' + type + "/" + id, null, function () { |
| | | febs.alert.success('设置成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: currPageGoods}}); |
| | | tableIns.reload({where: params, page: {curr: currPageMember}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: currPageGoods}, initSort: sortObject}); |
| | | tableIns.reload({where: getQueryParams(), page: {curr: currPageMember}, initSort: sortObject}); |
| | | }); |
| | | |
| | | function initTable() { |
| | |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'accountLogin', title: '登录账户', minWidth: 150,align:'left'}, |
| | | {field: 'phone', title: '手机号码', minWidth: 150,align:'left',hide:toolbarMallmember}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left', totalRowText: '合计:'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left',hide:toolbarMallmember}, |
| | | {field: 'balance', title: '余额', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.balance) }}'}, |
| | | {field: 'prizeScore', title: '现金积分', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.prizeScore) }}'}, |
| | | {field: 'star', title: '贡献点', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.star) }}'}, |
| | | {field: 'totalScore', title: '补贴额度', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.totalScore) }}'}, |
| | | {field: 'voucherCnt', title: '绿色凭证', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.voucherCnt) }}'}, |
| | | {field: 'voucherCntSurplus', title: '待释放数量', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.voucherCntSurplus) }}'}, |
| | | {field: 'voucherAmount', title: '凭证现金', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.voucherAmount) }}'}, |
| | | {field: 'voucherFireCnt', title: '能量值', minWidth: 100,align:'left',totalRow: '{{= parseInt(d.voucherFireCnt) }}'}, |
| | | {field: 'referrerName', title: '推荐人', minWidth: 100,align:'left'}, |
| | | {field: 'levelName', title: '会员类型', minWidth: 100,align:'left'}, |
| | | {field: 'storeMaster', title: '线下服务中心', templet:'#switchStoreMaster', minWidth: 120,align:'left',hide:toolbarMallmember}, |
| | | {field: 'director', title: '代理商', templet:'#switchDirector', minWidth: 120,align:'left' ,hide:toolbarMallmember}, |
| | | {field: 'creater', title: '联创', templet:'#switchCreate', minWidth: 120,align:'left' ,hide:toolbarMallmember}, |
| | | {field: 'partner', title: '合伙人', templet:'#switchPartner', minWidth: 120,align:'left' ,hide:toolbarMallmember}, |
| | | {field: 'insideWith', title: '是否内转', templet:'#switchInsideWith', minWidth: 120,align:'left' ,hide:toolbarMallmember}, |
| | | {field: 'outsideWith', title: '是否提现', templet:'#switchOutsideWith', minWidth: 120,align:'left' ,hide:toolbarMallmember}, |
| | | {field: 'accountType', title: '账号类型', |
| | | templet: function (d) { |
| | | if (d.accountType === 2) { |
| | | return '<span style="color:red;">测试账号</span>' |
| | | } else if (d.accountType === 1) { |
| | | return '<span style="color:green;">正常账号</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 100,align:'left'}, |
| | | {field: 'accountStatus', title: '账号状态', templet: '#switchStatus', minWidth: 100,align:'left',hide:toolbarMallmember}, |
| | | {field: 'createdTime', title: '注册时间', minWidth: 180,align:'left'}, |
| | | // {title: '操作', |
| | | // templet: function (d) { |
| | | // // '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="see" shiro:hasPermission="user:update">详情</button>' |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="moneyFlow:update" lay-event="moneyFlow">资金流水</button>' |
| | | // + '<button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="user:update" lay-event="updateReferer">修改推荐人</button>' |
| | | // // '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="moneyFlow" shiro:hasPermission="moneyFlow:update">资金流水</button>' |
| | | // // + '<button class="layui-btn layui-btn-normal layui-btn-xs" type="button" lay-event="updateReferer" shiro:hasPermission="user:update">修改推荐人</button>' |
| | | // },minWidth: 200,align:'center', fixed:"right"} |
| | | {title: '操作', minWidth: 200 ,toolbar: '#mallmember-option',hide:toolbarMallmember,align:'left', fixed:'right'} |
| | | ]] |
| | | }); |
| | |
| | | table.on('toolbar(userTable)', function(obj){ |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | |
| | | if (layEvent === 'exportMember') { |
| | | window.location.href = ctx + "admin/mallMember/exportMember"; |
| | | } |
| | | |
| | | if (layEvent === 'registMember') { |
| | | |
| | | febs.modal.open( '添加会员', 'modules/mallMember/addMember', { |
| | |
| | | |
| | | return; |
| | | } |
| | | |
| | | // var checkData = table.checkStatus('userTable').data; |
| | | // if (checkData.length <= 0) { |
| | | // febs.alert.warn('请选择需要的用户'); |
| | | // return; |
| | | // } |
| | | |
| | | if (layEvent === 'resetPwd') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'resetPayPwd') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | febs.modal.confirm('重置交易密码', '是否重置选中账号交易密码为【123456】?', function () { |
| | | var ids = []; |
| | | layui.each(checkData, function (key, item) { |
| | | ids.push(item.id) |
| | | }); |
| | | |
| | | resetPwd(ids.join(','), 1); |
| | | }); |
| | | } |
| | | |
| | | if (layEvent === 'balance') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length <= 0) { |
| | |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | systemPay("修改余额", checkData[0].id, 1); |
| | | } |
| | | |
| | | if (layEvent === 'voucherUpdate') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | voucherUpdate("拨付绿色凭证", checkData[0].id, 1); |
| | | } |
| | | |
| | | if (layEvent === 'score') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | systemPay("修改赠送积分", checkData[0].id, 2); |
| | | } |
| | | |
| | | if (layEvent === 'prizeScore') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | systemPay("修改竞猜积分", checkData[0].id, 3); |
| | | } |
| | | |
| | | if (layEvent === 'agentLevel') { |
| | | var checkData = table.checkStatus('userTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择需要的用户'); |
| | | return; |
| | | } |
| | | if (checkData.length > 1) { |
| | | febs.alert.warn('请选择一个用户'); |
| | | return; |
| | | } |
| | | febs.modal.open('设置代理级别', 'modules/mallMember/agentLevelSet/' + checkData[0].id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#agent-level-set').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | systemPay("拨付余额", checkData[0].id, 1); |
| | | } |
| | | }); |
| | | |
| | | function voucherUpdate(text, id, type) { |
| | | febs.modal.open(text, 'modules/mallMember/voucherUpdate/' + type +'/'+ id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#voucher-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function systemPay(text, id, type) { |
| | | febs.modal.open('text', 'modules/mallMember/mallSystemPay/' + type +'/'+ id, { |
| | | febs.modal.open(text, 'modules/mallMember/mallSystemPay/' + type +'/'+ id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#systemPay-update').find('#submit').trigger('click'); |
| | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | account: $searchForm.find('input[name="account"]').val().trim(), |
| | | accountLogin: $searchForm.find('input[name="accountLogin"]').val().trim(), |
| | | accountStatus: $searchForm.find("select[name='accountStatus']").val(), |
| | | level: $searchForm.find("select[name='level']").val(), |
| | | }; |
| | | } |
| | | |
| | | form.on('switch(switchInsideWith)', function (data) { |
| | | if (data.elem.checked) { |
| | | insideWithYes(data.value); |
| | | } else { |
| | | insideWithNo(data.value); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(switchOutsideWith)', function (data) { |
| | | if (data.elem.checked) { |
| | | outsideWithYes(data.value); |
| | | } else { |
| | | outsideWithNo(data.value); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(switchStatus)', function (data) { |
| | | if (data.elem.checked) { |
| | | openAccount(data.value); |
| | | } else { |
| | | closeAccount(data.value); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(switchStoreMaster)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(2, data.value); |
| | | } else { |
| | | changeIdentityNo(2, data.value); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(switchDirector)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(1, data.value); |
| | | } else { |
| | | changeIdentityNo(1, data.value); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(switchCreate)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(3, data.value); |
| | | } else { |
| | | changeIdentityNo(3, data.value); |
| | | } |
| | | }) |
| | | |
| | | form.on('switch(switchPartner)', function (data) { |
| | | if (data.elem.checked) { |
| | | changeIdentityYes(4, data.value); |
| | | } else { |
| | | changeIdentityNo(4, data.value); |
| | | } |
| | | }) |
| | | }) |
| | |
| | | {field: 'type', title: '流水类型', |
| | | templet: function (d) { |
| | | if (d.type === 1) { |
| | | return '<span>静态收益</span>' |
| | | return '<span>投注</span>' |
| | | } else if (d.type === 2) { |
| | | return '<span>直推奖</span>' |
| | | return '<span>中奖</span>' |
| | | } else if (d.type === 3) { |
| | | return '<span>代理收益</span>' |
| | | return '<span>充值</span>' |
| | | } else if (d.type === 4) { |
| | | return '<span>排名收益</span>' |
| | | }else if (d.type === 5) { |
| | | return '<span>总监收益</span>' |
| | | }else if (d.type === 6) { |
| | | return '<span>社区店补</span>' |
| | | }else if (d.type === 7) { |
| | | return '<span>一代收益</span>' |
| | | }else if (d.type === 8) { |
| | | return '<span>提现</span>' |
| | | }else if (d.type === 9) { |
| | | return '<span>转账</span>' |
| | | }else if (d.type === 10) { |
| | | return '<span>支付</span>' |
| | | }else if (d.type === 11) { |
| | | return '<span>退款</span>' |
| | | }else if (d.type === 12) { |
| | | return '<span>佣金转竞猜积分</span>' |
| | | }else if (d.type === 13) { |
| | | return '<span>佣金转余额</span>' |
| | | }else if (d.type === 14) { |
| | | return '<span>签到</span>' |
| | | }else if (d.type === 15) { |
| | | return '<span>感恩奖</span>' |
| | | }else if (d.type === 16) { |
| | | return '<span>系统拨付</span>' |
| | | }else if (d.type === 17) { |
| | | return '<span>抽奖</span>' |
| | | }else if (d.type === 18) { |
| | | return '<span>积分池收益</span>' |
| | | }else if (d.type === 19) { |
| | | return '<span>1星合伙人补贴</span>' |
| | | }else if (d.type === 20) { |
| | | return '<span>2星合伙人补贴</span>' |
| | | }else if (d.type === 21) { |
| | | return '<span>3星合伙人补贴</span>' |
| | | }else if (d.type === 22) { |
| | | return '<span>4星合伙人补贴</span>' |
| | | }else if (d.type === 23) { |
| | | return '<span>5星合伙人补贴</span>' |
| | | }else if (d.type === 24) { |
| | | return '<span>6星合伙人补贴</span>' |
| | | }else if (d.type === 25) { |
| | | return '<span>贡献点</span>' |
| | | }else if (d.type === 26) { |
| | | return '<span>补贴额度</span>' |
| | | }else if (d.type === 27) { |
| | | return '<span>团队补贴</span>' |
| | | }else if (d.type === 28) { |
| | | return '<span>平级奖励补贴</span>' |
| | | }else if (d.type === 29) { |
| | | return '<span>线下服务中心补贴</span>' |
| | | }else if (d.type === 30) { |
| | | return '<span>代理商补贴</span>' |
| | | }else if (d.type === 31) { |
| | | return '<span>联创合伙人释放凭证</span>' |
| | | }else if (d.type === 32) { |
| | | return '<span>业绩释放联创凭证</span>' |
| | | }else if (d.type === 33) { |
| | | return '<span>业绩释放合伙人凭证</span>' |
| | | }else if (d.type === 34) { |
| | | return '<span>业绩释放贡献点凭证</span>' |
| | | }else if (d.type === 35) { |
| | | return '<span>业绩释放星级凭证</span>' |
| | | }else if (d.type === 36) { |
| | | return '<span>能量值买入</span>' |
| | | }else if (d.type === 37) { |
| | | return '<span>红豆卖出</span>' |
| | | }else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'flowType', title: '资金类型', |
| | | templet: function (d) { |
| | | if (d.flowType === 1) { |
| | | return '余额'; |
| | | } else if(d.flowType === 3) { |
| | | return '现金积分' |
| | | } else if(d.flowType === 5) { |
| | | return '贡献点' |
| | | } else if(d.flowType === 7) { |
| | | return '能量值' |
| | | } else { |
| | | return '-'; |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'fromMemberName', title: '来自', minWidth: 80,align:'center'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150,align:'center'}, |
| | | {field: 'remark', title: '备注', minWidth: 150,align:'left'}, |
| | | {field: 'description', title: '备注', minWidth: 150,align:'left'}, |
| | | {field: 'createdTime', title: '时间', minWidth: 150,align:'left'} |
| | | ]] |
| | | }); |
| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.mall.dto.AgentLevelUpdateDto; |
| | | import cc.mrbird.febs.mall.dto.ApiMallActWinDetailsDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.quartz.ProfitJob; |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.mall.vo.ApiMallActWinDetailsVo; |
| | | import cc.mrbird.febs.mall.vo.ApiMallAwardDetailsVo; |
| | | import cc.mrbird.febs.rabbit.consumer.AgentConsumer; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.weaver.loadtime.Agent; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.pay.properties.WxPayProperties; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.lang.UUID; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.domain.AlipayTradeAppPayModel; |
| | | import com.alipay.api.response.AlipayTradeAppPayResponse; |
| | | import com.github.binarywang.wxpay.bean.order.WxPayAppOrderResult; |
| | | import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest; |
| | | import com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderResult; |
| | | import com.github.binarywang.wxpay.exception.WxPayException; |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| | | import com.ijpay.alipay.AliPayApi; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | /** |
| | |
| | | @SpringBootTest |
| | | public class PayTest { |
| | | |
| | | // @Test |
| | | // public void aliPay() throws AlipayApiException { |
| | | // AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); |
| | | // model.setBody("这是测试用"); |
| | | // model.setSubject("支付测试用的"); |
| | | // model.setOutTradeNo("2021092712215802974"); |
| | | // model.setTimeoutExpress("15m"); |
| | | // model.setTotalAmount("0.01"); |
| | | // model.setPassbackParams("callback params"); |
| | | // model.setProductCode("QUICK_MSECURITY_PAY"); |
| | | // AlipayTradeAppPayResponse resp = AliPayApi.appPayToResponse(model, ""); |
| | | // log.info("=====>>>{}", JSONObject.toJSONString(resp)); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private WxPayService wxPayService; |
| | | // |
| | | // @Autowired |
| | | // private WxPayProperties wxPayProperties; |
| | | // |
| | | // @Test |
| | | // public void wxPayTest() { |
| | | // WxPayUnifiedOrderRequest request = new WxPayUnifiedOrderRequest(); |
| | | // request.setAppid(wxPayProperties.getAppId()); |
| | | // request.setMchId(wxPayProperties.getMchId()); |
| | | // request.setNotifyUrl(wxPayProperties.getNoticeUrl()); |
| | | // request.setBody("这是body"); |
| | | // request.setOutTradeNo(RandomUtil.randomString(32)); |
| | | // request.setTimeExpire("20230407114500"); |
| | | // request.setSpbillCreateIp("127.0.0.1"); |
| | | // request.setTradeType("APP"); |
| | | // request.setTotalFee(1); |
| | | // try { |
| | | // WxPayAppOrderResult result = wxPayService.createOrder(request); |
| | | // System.out.println(1111); |
| | | // } catch (WxPayException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallOrderItem; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderItemMapper; |
| | | import cc.mrbird.febs.mall.quartz.OrderSettlementJob; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.pay.model.*; |
| | | import cc.mrbird.febs.pay.service.LaKaLaService; |
| | | import cc.mrbird.febs.pay.service.NBYHService; |
| | | import cc.mrbird.febs.pay.service.UnipayService; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.ResourceLoader; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @SpringBootTest |
| | | public class ProfitTest { |
| | | |
| | | @Autowired |
| | | private IAgentService agentService; |
| | | // @Autowired |
| | | // private AgentConsumer agentConsumer; |
| | | // |
| | | // @Autowired |
| | | // private IAgentService agentService; |
| | | // |
| | | // @Autowired |
| | | // private IMemberProfitService memberProfitService; |
| | | // |
| | | // @Autowired |
| | | // private IApiMallOrderInfoService iApiMallOrderInfoService; |
| | | // |
| | | // @Autowired |
| | | // private MallMemberMapper memberMapper; |
| | | // |
| | | // @Autowired |
| | | // private AgentProducer agentProducer; |
| | | // |
| | | // @Test |
| | | // public void dynamicProfit() { |
| | | // agentService.perkMoneyConsumer(Long.parseLong("796")); |
| | | //// memberProfitService.dynamicProfit(Long.parseLong("709")); |
| | | //// memberProfitService.scoreRecordReleaseJob(); |
| | | //// memberProfitService.achieveReleaseJob(); |
| | | //// agentProducer.sendPerkMoneyMsg(679L); |
| | | //// agentService.perkMoneyConsumer(665L); |
| | | //// memberProfitService.teamEqualsPerkJob(null); |
| | | //// List<MallMember> mallMemberTeamPerk = new ArrayList<>(); |
| | | //// MallMember mallMember = memberMapper.selectById(233L); |
| | | //// List<String> ids = StrUtil.split(mallMember.getReferrerIds(), ','); |
| | | //// List<MallMember> mallMembers = memberMapper.selectByInviteIds(ids); |
| | | //// Map<String, List<MallMember>> collect = mallMembers.stream().collect(Collectors.groupingBy(MallMember::getLevel)); |
| | | //// Set<String> set = collect.keySet(); // 得到所有key的集合 |
| | | //// for (String key : set) { |
| | | //// List<MallMember> value = collect.get(key); |
| | | //// System.out.println(key + " " + value); |
| | | //// mallMemberTeamPerk.add(value.get(0)); |
| | | //// |
| | | //// System.out.println(value.get(0).getName()); |
| | | //// |
| | | //// } |
| | | //// List<Long> mallMemberStarIds = mallMemberTeamPerk.stream().map(MallMember::getId).collect(Collectors.toList()); |
| | | //// |
| | | //// System.out.println(mallMemberStarIds); |
| | | // } |
| | | |
| | | |
| | | @Autowired |
| | | private LaKaLaService laKaLaService; |
| | | @Autowired |
| | | ResourceLoader resourceLoader; |
| | | @Autowired |
| | | private NBYHService nbyhService; |
| | | @Autowired |
| | | private IAdminMallMemberService mallMemberService; |
| | | |
| | | @Test |
| | | public void agentProfitTrade() { |
| | | // try { |
| | | // System.out.println(resourceLoader.getResource("classpath:lkl/api_private_key.pem").getInputStream()); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // nbyhService.tradeSinge(306L); |
| | | // nbyhService.tradeSingeOuterTransfer(306L); |
| | | // nbyhService.accountInfoQuery(306L); |
| | | // nbyhService.transferResultInfoQuery(315L); |
| | | // |
| | | // mallMemberService.chargeAgree(307L); |
| | | // mallMemberService.searchInfo(307L); |
| | | |
| | | // agentService.perkAgent(); |
| | | } |
| | | @Test |
| | | public void agentProfit() { |
| | | // try { |
| | | // System.out.println(resourceLoader.getResource("classpath:lkl/api_private_key.pem").getInputStream()); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // LaKaLaCreateOrderReqDate laKaLaCreateOrderReqDate = new LaKaLaCreateOrderReqDate(); |
| | | // //订单编号 |
| | | // laKaLaCreateOrderReqDate.setOut_order_no("2023041918302032901"); |
| | | // //订单金额,分计 |
| | | // laKaLaCreateOrderReqDate.setTotal_amount(new BigDecimal(1).longValue()); |
| | | // laKaLaCreateOrderReqDate.setOrder_info("礼品一"); |
| | | // laKaLaService.verifyCreateOrder(laKaLaCreateOrderReqDate); |
| | | } |
| | | // |
| | | // |
| | | //// @Test |
| | | //// public void staticProfit() { |
| | | //// memberProfitService.staticProfit(new Date()); |
| | | //// } |
| | | // |
| | | // @Test |
| | | // public void thankfulProfit() { |
| | | // memberProfitService.mqPerkRetryJob(); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void rankProfit() { |
| | | // memberProfitService.rankProfit(); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private MallOrderInfoMapper mallOrderInfoMapper; |
| | | // |
| | | // @Test |
| | | // public void directorProfitTest() { |
| | | // memberProfitService.storeAndDirectorProfit(new Date()); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private MallOrderItemMapper mallOrderItemMapper; |
| | | // |
| | | // @Autowired |
| | | // private IMallAchieveService mallAchieveService; |
| | | // |
| | | // @Test |
| | | // public void achieveTest() { |
| | | // List<MallOrderItem> items = mallOrderItemMapper.selectList(null); |
| | | // for (MallOrderItem item : items) { |
| | | // mallAchieveService.add(item.getId()); |
| | | // } |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void paramTest() { |
| | | // Map<String, Integer> map = new HashMap<>(); |
| | | // BigDecimal amount = new BigDecimal("100"); |
| | | // map.put("amount", 1); |
| | | // changeAmount(map); |
| | | // System.out.println(map.get("amount")); |
| | | // } |
| | | // |
| | | // public void changeAmount(Map<String, Integer> amount) { |
| | | // amount.put("amount", 2); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void scorePool(){ |
| | | // memberProfitService.scorePool(); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void staticProfit(){ |
| | | // memberProfitService.staticProfit(null); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private OrderSettlementJob orderSettlementJob; |
| | | // |
| | | // @Test |
| | | // public void orderSettlementJobTest() { |
| | | //// orderSettlementJob.normalGoodsSettlementJob(); |
| | | // |
| | | // mallAchieveService.add(83L); |
| | | // } |
| | | // |
| | | // |
| | | // @Autowired |
| | | // private UnipayService unipayService; |
| | | // @Test |
| | | // public void unipay(){ |
| | | // UnipayDto unipayDto = new UnipayDto(); |
| | | // unipayDto.setAmount(new BigDecimal("0.01")); |
| | | // unipayDto.setFrpCode("ALIPAY_H5"); |
| | | // unipayDto.setTradeMerchantNo("777180800385820"); |
| | | //// unipayDto.setFrpCode("WEIXIN_APP3"); |
| | | // unipayDto.setOrderNo("2022082316415386395"); |
| | | // unipayDto.setProductName("洗护套装"); |
| | | // unipayService.unipay(unipayDto); |
| | | // } |
| | | // @Test |
| | | // public void getAgreeMentPaySms(){ |
| | | // AgreeMentPaySmsDto agreeMentPaySmsDto = new AgreeMentPaySmsDto(); |
| | | // agreeMentPaySmsDto.setOrderNo("2022082617305930328"); |
| | | // |
| | | // BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN); |
| | | // DecimalFormat decimalFormat = new DecimalFormat("0.00#"); |
| | | // String strVal = decimalFormat.format(value); |
| | | // agreeMentPaySmsDto.setOrderAmount(new BigDecimal(strVal)); |
| | | // agreeMentPaySmsDto.setName("肖永"); |
| | | // agreeMentPaySmsDto.setCreatedTime(DateUtil.now()); |
| | | // agreeMentPaySmsDto.setIdType("1"); |
| | | // agreeMentPaySmsDto.setIdCardNum("430321199310113713"); |
| | | // agreeMentPaySmsDto.setBankNo("6222031901002389639"); |
| | | // agreeMentPaySmsDto.setPhone("15274802129"); |
| | | // String agreeMentPaySms = unipayService.getAgreeMentPaySms(agreeMentPaySmsDto); |
| | | // if("JS000000".equals(agreeMentPaySms)){ |
| | | // System.out.println("获取成功"); |
| | | // }else{ |
| | | // System.out.println(agreeMentPaySms); |
| | | // } |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void agreementSign(){ |
| | | // AgreementSignDto agreementSignDto = new AgreementSignDto(); |
| | | // agreementSignDto.setOrderNo("2022082614465345250"); |
| | | // agreementSignDto.setSmsCode("841243"); |
| | | // unipayService.agreementSign(agreementSignDto); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void agreementPay(){ |
| | | // AgreementPayDto agreementPayDto = new AgreementPayDto(); |
| | | // agreementPayDto.setOrderNo("2022082614465345250"); |
| | | // |
| | | // BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN); |
| | | // DecimalFormat decimalFormat = new DecimalFormat("0.00#"); |
| | | // String strVal = decimalFormat.format(value); |
| | | // agreementPayDto.setOrderAmount(new BigDecimal(strVal)); |
| | | // agreementPayDto.setOrderTime(DateUtil.now()); |
| | | // agreementPayDto.setOrderDesc("测试"); |
| | | // agreementPayDto.setBankNo("6222031901002389639"); |
| | | // unipayService.agreementPay(agreementPayDto); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void singlePay(){ |
| | | // /** |
| | | // * 调用汇聚代付 |
| | | // */ |
| | | // String orderNo = MallUtils.getOrderNum("W"); |
| | | // SinglePayDto singlePayDto = new SinglePayDto(); |
| | | // singlePayDto.setMerchantOrderNo(orderNo); |
| | | // singlePayDto.setReceiverAccountNoEncBankNo("6222031903210023839639"); |
| | | // singlePayDto.setReceiverAccountNoEncName("肖永"); |
| | | // singlePayDto.setReceiverAccountType("201"); |
| | | // BigDecimal paidAmount = new BigDecimal(1.00); |
| | | // singlePayDto.setPaidAmount(paidAmount); |
| | | // singlePayDto.setCurrency("201"); |
| | | // singlePayDto.setIsChecked("202"); |
| | | // singlePayDto.setPaidDesc("用户提现"); |
| | | // singlePayDto.setPaidUse("202"); |
| | | // String singlePayRep = unipayService.singlePay(singlePayDto); |
| | | // |
| | | // System.out.println(singlePayRep); |
| | | // } |
| | | } |