| | |
| | | |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.feignclient.other.SysLogClient; |
| | | import com.dsh.account.model.vo.userBenefitDetail.AppUserDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.BillingDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.IndexOfUserBenefirVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.*; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 使用福利 控制器 |
| | |
| | | |
| | | @Resource |
| | | private SysLogClient slClient; |
| | | |
| | | @Autowired |
| | | private RechargeRecordsService rechargeRService; |
| | | |
| | | private final SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "记录id", name = "recordId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<BillingDetailsVo> getUserBillingDetails(String yearMonth,Integer recordId){ |
| | | try { |
| | |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tauService.queryUserBillingDetails(yearMonth,recordId)); |
| | | return ResultUtil.success(tauService.queryUserBillingDetails(yearMonth,recordId,appUserId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/voucherCenter") |
| | | @ApiOperation(value = "充值明细", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<RechargeDetailsVo> wpGoldRechargeRecord(String yearMonth, Integer recordId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(rechargeRService.getAppUserRechargeRecord(yearMonth,recordId,appUserId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/voucherCenter") |
| | | @ApiOperation(value = "充值中心", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<RechargeCentVo>> rechargeCenterConfig(){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tauService.getSysRechargeConfig(appUserId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 课时详情-支付 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/payment") |
| | | @ApiOperation(value = "充值中心-支付", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil continuationOperation(RechargePayRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return rechargeRService.rechargePayment(userIdFormRedis,request); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | CANCEL_VENUE_RESERVATION("取消场地预约"), |
| | | |
| | | |
| | | ; |
| | | String msg; |
| | | |
| | | RechargeRecordEnum() { |
| | | } |
| | | ; |
| | | final String msg; |
| | | |
| | | RechargeRecordEnum(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/coursePack/courseOfPurchased") |
| | | List<PurchaseVo> getAppUsersCourseData(@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/base/coursePack/allPaymentCourseList") |
| | | public List<TCoursePackagePayment> getAppuserCourseList(@RequestBody Integer appUserId); |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other; |
| | | |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface RechargeConfigClient { |
| | | |
| | | @PostMapping("/base/stored/getRechargeArrange") |
| | | List<Map<String,Object>> getRechargeConfig(); |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ClasspaymentRequest { |
| | | |
| | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Long courseConfigId; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | private BigDecimal payAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.userBenefitDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ArrangeResponse { |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private String wpGold; |
| | | |
| | | @ApiModelProperty(value = "对应充值金额") |
| | | private String amount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.userBenefitDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RechargeCentVo { |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private String wpGold; |
| | | |
| | | @ApiModelProperty(value = "对应充值金额") |
| | | private String amount; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.userBenefitDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RechargeDetailsVo { |
| | | |
| | | @ApiModelProperty(value = "剩余玩湃币") |
| | | private Integer wpGold; |
| | | |
| | | @ApiModelProperty(value = "记录列表") |
| | | private List<RechargesDetail> detailList; |
| | | |
| | | @Data |
| | | public static class RechargesDetail{ |
| | | |
| | | @ApiModelProperty(value = "名称") |
| | | private String consumeName; |
| | | |
| | | @ApiModelProperty(value = "时间") |
| | | private String consumeTime; |
| | | |
| | | @ApiModelProperty(value = "金额 例如 -90 ") |
| | | private String consumeAmount; |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.userBenefitDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | |
| | | @Data |
| | | public class RechargePayRequest { |
| | | |
| | | |
| | | @ApiModelProperty(value = "支付方式 1微信 2支付宝") |
| | | private Integer payType; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | private BigDecimal payAmount; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.RechargeRecords; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargeDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargePayRequest; |
| | | import com.dsh.account.util.ResultUtil; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface RechargeRecordsService extends IService<RechargeRecords> { |
| | | |
| | | RechargeDetailsVo getAppUserRechargeRecord(String yearMonth, Integer recordId, Integer appUserId); |
| | | |
| | | ResultUtil rechargePayment(Integer userIdFormRedis, RechargePayRequest request); |
| | | |
| | | } |
| | |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.BillingDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.IndexOfUserBenefirVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargeCentVo; |
| | | import com.dsh.account.util.ResultUtil; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param recordId 记录id |
| | | * @return |
| | | */ |
| | | BillingDetailsVo queryUserBillingDetails(String yearMonth, Integer recordId); |
| | | BillingDetailsVo queryUserBillingDetails(String yearMonth, Integer recordId,Integer appUserId); |
| | | |
| | | /** |
| | | * 注销账号 |
| | |
| | | */ |
| | | void cancellation(Integer appUserId); |
| | | |
| | | List<RechargeCentVo> getSysRechargeConfig(Integer appUserId); |
| | | } |
| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.RechargeRecords; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.enums.RechargeRecordEnum; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.TCoursePackagePayment; |
| | | import com.dsh.account.mapper.RechargeRecordsMapper; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargeDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargePayRequest; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.util.DateTimeHelper; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class RechargeRecordsServiceImpl extends ServiceImpl<RechargeRecordsMapper, RechargeRecords> implements RechargeRecordsService { |
| | | |
| | | @Resource |
| | | private RechargeRecordsMapper rereMapper; |
| | | |
| | | |
| | | @Resource |
| | | private TAppUserMapper tappMapper; |
| | | |
| | | @Autowired |
| | | private CoursePaymentClient cpClient; |
| | | |
| | | |
| | | @Override |
| | | public RechargeDetailsVo getAppUserRechargeRecord(String yearMonth, Integer recordId, Integer appUserId) { |
| | | RechargeDetailsVo vo = new RechargeDetailsVo(); |
| | | List<RechargeDetailsVo.RechargesDetail> details = new ArrayList<>(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | Date monthStart = null; |
| | | Date monthEnd = null; |
| | | if (StringUtils.hasText(yearMonth)) { |
| | | monthStart = DateTimeHelper.getCurrentIdetMouthStart(yearMonth); |
| | | monthEnd = DateTimeHelper.getCurrentIdeaMouthEnd(yearMonth); |
| | | } else { |
| | | monthStart = DateTimeHelper.getCurrentMouthStart(); |
| | | monthEnd = DateTimeHelper.getCurrentMouthEnd(); |
| | | } |
| | | |
| | | TAppUser tAppUser = tappMapper.selectById(appUserId); |
| | | if (null != tAppUser){ |
| | | vo.setWpGold(tAppUser.getPlayPaiCoins()); |
| | | }else { |
| | | vo.setWpGold(0); |
| | | } |
| | | // 1.赛事报名 |
| | | |
| | | // 2.课包购买 |
| | | List<TCoursePackagePayment> appuserCourseList = cpClient.getAppuserCourseList(appUserId); |
| | | if (appuserCourseList.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : appuserCourseList) { |
| | | RechargeDetailsVo.RechargesDetail consumeDetail = new RechargeDetailsVo.RechargesDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.COURSE_PACKAGE_PURCHASE.getMsg() ); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(tCoursePackagePayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + tCoursePackagePayment.getPlayPaiCoin()); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 3.场地预约 |
| | | // 4.智慧球场 |
| | | |
| | | // 5.充值 |
| | | List<RechargeRecords> rechargeRecords = rereMapper.selectList(new QueryWrapper<RechargeRecords>() |
| | | .eq("payStatus", 2) |
| | | .eq("appUserId", appUserId) |
| | | .between("insertTime", monthStart, monthEnd)); |
| | | if (rechargeRecords.size() > 0) { |
| | | for (RechargeRecords rechargeRecord : rechargeRecords) { |
| | | RechargeDetailsVo.RechargesDetail consumeDetail = new RechargeDetailsVo.RechargesDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.name() + ":" + rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(rechargeRecord.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+" + rechargeRecord.getAmount()); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | vo.setDetailList(details); |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil rechargePayment(Integer userIdFormRedis, RechargePayRequest request) { |
| | | // TODO: 2023/7/10 充值支付 |
| | | switch (request.getPayType()){ |
| | | case 1: |
| | | WeChatPayment(request.getPayAmount()); |
| | | break; |
| | | case 2: |
| | | AlipayPayment(request.getPayAmount()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | private void AlipayPayment(BigDecimal payAmount) { |
| | | |
| | | |
| | | } |
| | | |
| | | private void WeChatPayment(BigDecimal payAmount) { |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | import com.dsh.account.feignclient.course.model.QueryStoreList; |
| | | import com.dsh.account.feignclient.course.model.StuCourseResp; |
| | | import com.dsh.account.feignclient.other.ImgConfigClient; |
| | | import com.dsh.account.feignclient.other.RechargeConfigClient; |
| | | import com.dsh.account.feignclient.other.StoreClient; |
| | | import com.dsh.account.feignclient.other.model.Store; |
| | | import com.dsh.account.feignclient.other.model.TImgConfig; |
| | |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.BillingDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.IndexOfUserBenefirVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargeCentVo; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.util.akeylogin.Md5Util; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private RechargeRecordsMapper rrMapper; |
| | | |
| | | @Resource |
| | | private RechargeConfigClient reconMapper; |
| | | |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id,String latitude,String longitude) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public BillingDetailsVo queryUserBillingDetails(String yearMonth, Integer recordId) { |
| | | public BillingDetailsVo queryUserBillingDetails(String yearMonth, Integer recordId, Integer appUserId) { |
| | | BillingDetailsVo vo = new BillingDetailsVo(); |
| | | List<BillingDetailsVo.ConsumeDetail> details = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | if (null != yearMonth){ |
| | | |
| | | Date monthStart = DateTimeHelper.getCurrentIdetMouthStart(yearMonth); |
| | | Date monthEnd = DateTimeHelper.getCurrentIdeaMouthEnd(yearMonth); |
| | | // 1.赛事报名 |
| | | // 2.课包购买 |
| | | |
| | | // 3.场地预约 |
| | | // 4.智慧球场 |
| | | // 5.年度会员 |
| | | List<VipPayment> vipPayments = vipPaymentMapper.selectList(new QueryWrapper<VipPayment>() |
| | | .eq("payStatus",2 ) |
| | | .between("insertTime",monthStart, monthEnd)); |
| | | if (vipPayments.size() > 0){ |
| | | for (VipPayment vipPayment : vipPayments) { |
| | | BillingDetailsVo.ConsumeDetail consumeDetail = new BillingDetailsVo.ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.ANNUAL_MEMBERSHIP.name()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(vipPayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+"+vipPayment.getAmount()); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 6.续课 |
| | | // 7.充值 |
| | | List<RechargeRecords> rechargeRecords = rrMapper.selectList(new QueryWrapper<RechargeRecords>() |
| | | .eq("payStatus", 2) |
| | | .between("insertTime",monthStart, monthEnd)); |
| | | if (rechargeRecords.size() > 0){ |
| | | for (RechargeRecords rechargeRecord : rechargeRecords) { |
| | | BillingDetailsVo.ConsumeDetail consumeDetail = new BillingDetailsVo.ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.name()+":"+rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(rechargeRecord.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+"+rechargeRecord.getAmount()); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | Date monthStart = null; |
| | | Date monthEnd = null; |
| | | if (StringUtils.hasText(yearMonth)) { |
| | | monthStart = DateTimeHelper.getCurrentIdetMouthStart(yearMonth); |
| | | monthEnd = DateTimeHelper.getCurrentIdeaMouthEnd(yearMonth); |
| | | }else { |
| | | Date currentMouthStart = DateTimeHelper.getCurrentMouthStart(); |
| | | Date currentMouthEnd = DateTimeHelper.getCurrentMouthEnd(); |
| | | monthStart = DateTimeHelper.getCurrentMouthStart(); |
| | | monthEnd = DateTimeHelper.getCurrentMouthEnd(); |
| | | } |
| | | // 1.赛事报名 |
| | | // 2.课包购买 |
| | | |
| | | // 3.场地预约 |
| | | // 4.智慧球场 |
| | | // 5.年度会员 |
| | | List<VipPayment> vipPayments = vipPaymentMapper.selectList(new QueryWrapper<VipPayment>() |
| | | .eq("payStatus",2 ) |
| | | .between("insertTime",currentMouthStart, currentMouthEnd)); |
| | | .eq("appUserId", appUserId) |
| | | .between("insertTime", monthStart, monthEnd)); |
| | | if (vipPayments.size() > 0){ |
| | | for (VipPayment vipPayment : vipPayments) { |
| | | BillingDetailsVo.ConsumeDetail consumeDetail = new BillingDetailsVo.ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.ANNUAL_MEMBERSHIP.name()); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.ANNUAL_MEMBERSHIP.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(vipPayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+"+vipPayment.getAmount()); |
| | | details.add(consumeDetail); |
| | |
| | | // 7.充值 |
| | | List<RechargeRecords> rechargeRecords = rrMapper.selectList(new QueryWrapper<RechargeRecords>() |
| | | .eq("payStatus", 2) |
| | | .between("insertTime",currentMouthStart, currentMouthEnd)); |
| | | .eq("appUserId", appUserId) |
| | | .between("insertTime", monthStart, monthEnd)); |
| | | if (rechargeRecords.size() > 0){ |
| | | for (RechargeRecords rechargeRecord : rechargeRecords) { |
| | | BillingDetailsVo.ConsumeDetail consumeDetail = new BillingDetailsVo.ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.name()+":"+rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.getMsg() + ":" + rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(rechargeRecord.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+"+rechargeRecord.getAmount()); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | } |
| | | |
| | | vo.setDetails(details); |
| | | return vo; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<RechargeCentVo> getSysRechargeConfig(Integer appUserId) { |
| | | List<RechargeCentVo> centVos = new ArrayList<>(); |
| | | TAppUser tAppUser = this.baseMapper.selectById(appUserId); |
| | | List<Map<String, Object>> rechargeConfig = reconMapper.getRechargeConfig(); |
| | | if (rechargeConfig.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : rechargeConfig) { |
| | | RechargeCentVo vo = new RechargeCentVo(); |
| | | vo.setAmount("¥ "+stringObjectMap.get("money")); |
| | | if (tAppUser.getIsVip() == 1){ |
| | | vo.setWpGold(stringObjectMap.get("MemberCoins")+"币"); |
| | | }else { |
| | | vo.setWpGold(stringObjectMap.get("usersCoins")+"币"); |
| | | } |
| | | centVos.add(vo); |
| | | } |
| | | } |
| | | return centVos; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dsh.competition.controller; |
| | | |
| | | |
| | | import com.dsh.competition.util.ResultUtil; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.xml.transform.Result; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.PostCourseVideo; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | |
| | | return videoVos; |
| | | } |
| | | |
| | | @PostMapping("/base/coursePack/allPaymentCourseList") |
| | | public List<TCoursePackagePayment> getAppuserCourseList(@RequestBody Integer appUserId){ |
| | | return packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",appUserId) |
| | | .eq("payType",3) |
| | | .eq("payStatus",2) |
| | | .eq("state",1)); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @PostMapping("/base/coursePack/courseOfPurchased") |
| | | public List<PurchaseVo> getAppUsersCourseData(@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/base/coursePack/allPaymentCourseList") |
| | | public List<TCoursePackagePayment> getAppuserCourseList(@RequestBody Integer appUserId); |
| | | } |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | |
| | | import com.dsh.other.entity.StoredValueConfig; |
| | | import com.dsh.other.service.StoredValueConfigService; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 储值规则配置控制器 |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class StoredValueConfigController { |
| | | |
| | | |
| | | @Autowired |
| | | private StoredValueConfigService svconfigService; |
| | | |
| | | @ResponseBody |
| | | |
| | | @PostMapping("/base/stored/getRechargeArrange") |
| | | public List<Map<String,Object>> getRechargeConfig(){ |
| | | List<Map<String,Object>> responses = new ArrayList<>(); |
| | | StoredValueConfig storedValueConfig = svconfigService.list().get(0); |
| | | try { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | JsonNode rulesNode = objectMapper.readTree(storedValueConfig.getContent()).path("rules"); |
| | | if (rulesNode.isArray()) { |
| | | for (JsonNode ruleNode : rulesNode) { |
| | | Map<String,Object> de = new HashMap<>(); |
| | | String money = ruleNode.get("money").asText(); |
| | | String usersCoins = ruleNode.get("usersCoins").asText(); |
| | | String MemberCoins = ruleNode.get("MemberCoins").asText(); |
| | | de.put("money",money); |
| | | de.put("usersCoins",usersCoins); |
| | | de.put("MemberCoins",MemberCoins); |
| | | responses.add(de); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return responses; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/stored/rechargeDescription") |
| | | @ApiOperation(value = "充值中心-储值说明", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | }) |
| | | public ResultUtil<String> rechargeCenterConfig(){ |
| | | try { |
| | | StoredValueConfig storedValueConfig = svconfigService.list().get(0); |
| | | return ResultUtil.success(storedValueConfig.getDescription()); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 储值规则配置 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_stored_value_config") |
| | | public class StoredValueConfig extends Model<StoredValueConfig> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 规则配置JSON |
| | | { |
| | | "rules": [{ |
| | | "money": "100.0", |
| | | "usersCoins": "100.0", |
| | | "MemberCoins": "100.0", |
| | | "startTime": "", |
| | | "endTime": "" |
| | | }, { |
| | | "money": "200.0", |
| | | "usersCoins": "200.0", |
| | | "MemberCoins": "200.0", |
| | | "startTime": "", |
| | | "endTime": "" |
| | | }], |
| | | "time_rules": [{ |
| | | "sameTime": [{ |
| | | "money": "100.0", |
| | | "usersCoins": "100.0", |
| | | "MemberCoins": "200.0", |
| | | "startTime": "2023-06-01", |
| | | "endTime": "2023-06-15" |
| | | }, { |
| | | "money": "200.0", |
| | | "usersCoins": "200.0", |
| | | "MemberCoins": "400.0", |
| | | "startTime": "2023-06-01", |
| | | "endTime": "2023-06-15" |
| | | }] |
| | | }, { |
| | | "sameTime": [{ |
| | | "money": "100.0", |
| | | "usersCoins": "100.0", |
| | | "MemberCoins": "300.0", |
| | | "startTime": "2023-07-01", |
| | | "endTime": "2023-07-15" |
| | | }, { |
| | | "money": "200.0", |
| | | "usersCoins": "200.0", |
| | | "MemberCoins": "600.0", |
| | | "startTime": "2023-07-01", |
| | | "endTime": "2023-07-15" |
| | | }] |
| | | }] |
| | | } |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 储值说明 |
| | | */ |
| | | private String description; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface RechargeConfigClient { |
| | | |
| | | @PostMapping("/base/stored/getRechargeArrange") |
| | | List<Map<String,Object>> getRechargeConfig(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.StoredValueConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 储值规则配置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | public interface StoredValueConfigMapper extends BaseMapper<StoredValueConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.StoredValueConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * 储值规则配置 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | public interface StoredValueConfigService extends IService<StoredValueConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.StoredValueConfig; |
| | | import com.dsh.other.mapper.StoredValueConfigMapper; |
| | | import com.dsh.other.service.StoredValueConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 储值规则配置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | @Service |
| | | public class StoredValueConfigServiceImpl extends ServiceImpl<StoredValueConfigMapper, StoredValueConfig> implements StoredValueConfigService { |
| | | |
| | | } |
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="com.dsh.other.mapper.StoredValueConfigMapper"> |
| | | |
| | | |
| | | </mapper> |