| | |
| | | EVENT_REGISTRATION("赛事报名"), |
| | | CANCEL_EVENT_REGISTRATION("取消赛事报名"), |
| | | CANCEL_VENUE_RESERVATION("取消场地预约"), |
| | | WORLD_CIP_PAYMENT("世界杯报名"), |
| | | CANCEL_WORLD_CIP_PAYMENT("取消世界杯报名"), |
| | | |
| | | |
| | | ; |
New file |
| | |
| | | package com.dsh.account.feignclient.communityWorldCup; |
| | | |
| | | import com.dsh.account.feignclient.communityWorldCup.model.GetWorldCupPayment; |
| | | import com.dsh.account.model.WorldCupPayment; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2024/3/12 17:47 |
| | | */ |
| | | @FeignClient("mb-cloud-communityWorldCup") |
| | | public interface WorldCupPaymentClinet { |
| | | |
| | | |
| | | /** |
| | | * 获取世界杯报名列表 |
| | | * @param getWorldCupPayment |
| | | * @return |
| | | */ |
| | | @PostMapping("/worldCup/getWorldCupPayment") |
| | | List<WorldCupPayment> getWorldCupPayment(GetWorldCupPayment getWorldCupPayment); |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.communityWorldCup.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2024/3/12 17:51 |
| | | */ |
| | | @Data |
| | | public class GetWorldCupPayment { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/2/22 14:15 |
| | | */ |
| | | @Data |
| | | public class WorldCupPayment { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 世界杯id |
| | | */ |
| | | private Integer worldCupId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 支付单价 |
| | | */ |
| | | private BigDecimal unitPrice; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private BigDecimal amount; |
| | | /** |
| | | * 支付状态(1=待支付,2=已支付,3=已退款) |
| | | */ |
| | | private Integer payStatus; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTime; |
| | | /** |
| | | * 第三方支付流水号 |
| | | */ |
| | | private String payOrderNo; |
| | | /** |
| | | * 退款时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date refundTime; |
| | | /** |
| | | * 第三方退款流水号 |
| | | */ |
| | | private String refundOrderNo; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | /** |
| | | * 参赛人数据 |
| | | */ |
| | | private String entrant; |
| | | } |
| | |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.VipPayment; |
| | | import com.dsh.account.enums.RechargeRecordEnum; |
| | | import com.dsh.account.feignclient.communityWorldCup.WorldCupPaymentClinet; |
| | | import com.dsh.account.feignclient.communityWorldCup.model.GetWorldCupPayment; |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.PaymentCompetition; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | |
| | | import com.dsh.account.mapper.RechargeRecordsMapper; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.model.IncomeQuery; |
| | | import com.dsh.account.model.WorldCupPayment; |
| | | import com.dsh.account.model.query.RechargeRecordsQuery; |
| | | import com.dsh.account.model.vo.RechargeRecordsVO; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargeDetailsVo; |
| | |
| | | |
| | | @Resource |
| | | private RechargeConfigClient reconMapper; |
| | | @Autowired |
| | | @Resource |
| | | private RechargeRecordsMapper rechargeRecordsMapper; |
| | | |
| | | @Resource |
| | | private WorldCupPaymentClinet worldCupPaymentClinet; |
| | | |
| | | |
| | | @Override |
| | |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | |
| | | //世界杯 |
| | | GetWorldCupPayment getWorldCupPayment = new GetWorldCupPayment(); |
| | | getWorldCupPayment.setAppUserId(appUserId); |
| | | getWorldCupPayment.setPayType(3); |
| | | getWorldCupPayment.setStartTime(monthStart); |
| | | getWorldCupPayment.setEndTime(monthEnd); |
| | | List<WorldCupPayment> worldCupPayment = worldCupPaymentClinet.getWorldCupPayment(getWorldCupPayment); |
| | | for (WorldCupPayment cupPayment : worldCupPayment) { |
| | | RechargesDetail consumeDetail = new RechargesDetail(); |
| | | if(cupPayment.getPayStatus() != 3){ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.WORLD_CIP_PAYMENT.getMsg() + ":¥" + cupPayment.getAmount()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("-" + cupPayment.getAmount()); |
| | | consumeDetail.setRecordId(2); |
| | | }else{ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_WORLD_CIP_PAYMENT.getMsg() + ":¥" + cupPayment.getAmount()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("+" + cupPayment.getAmount()); |
| | | consumeDetail.setRecordId(1); |
| | | } |
| | | details.add(consumeDetail); |
| | | } |
| | | |
| | | |
| | | if (ToolUtil.isNotEmpty(recordId)) { |
| | | details = details.stream() |
| | | .filter(record -> record.getRecordId().equals(recordId)) |
| | |
| | | @Resource |
| | | private CouponCityService cityService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询注册赠送优惠券 判断当前优惠券限领数量 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<CouponPackageResp>> queryAppuserCouponList(CouponPackageReq req) { |
| | | public ResultUtil<List<CouponPackageResp>> queryCouponPackage(CouponPackageReq req) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | |
| | | Participant participant = participantClient.getParticipant(worldCupPaymentParticipant.getParticipantId()); |
| | | worldCupPeopleVo.setName(participant.getName()); |
| | | worldCupPeopleVo.setAge(null == participant.getBirthday() ? 0 : Integer.valueOf(sdf.format(new Date())) -Integer.valueOf(sdf.format(participant.getBirthday()))); |
| | | worldCupPeopleVo.setAvatar(appUser.getHeadImg()); |
| | | worldCupPeopleVo.setAvatar(participant.getHeadImg()); |
| | | worldCupPeopleVo.setParticipantType(2); |
| | | } |
| | | return ResultUtil.success(worldCupPeopleVo); |
| | |
| | | } |
| | | return worldCupPaymentParticipantService.getCount(worldCupId, collect); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取支付记录 |
| | | * @param getWorldCupPayment |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/getWorldCupPayment") |
| | | public List<WorldCupPayment> getWorldCupPayment(@RequestBody GetWorldCupPayment getWorldCupPayment){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | return worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("appUserId", getWorldCupPayment.getAppUserId()) |
| | | .eq("payType", getWorldCupPayment.getPayType()).ne("payStatus", 1).eq("state", 1) |
| | | .last(" and createTime between '" + sdf.format(getWorldCupPayment.getStartTime()) + "' and '" + sdf.format(getWorldCupPayment.getEndTime()) + "' order by createTime desc")); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 头像 |
| | | */ |
| | | private String headImg; |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | |
| | | |
| | | |
| | | Map<String, Object> getUserGameRecordList(@Param("participantType") Integer participantType, @Param("participantId") Long participantId); |
| | | |
| | | |
| | | /** |
| | | * 获取比赛场次 |
| | | * @param worldCupId |
| | | * @return |
| | | */ |
| | | int getMatchTime(@Param("worldCupId") Integer worldCupId); |
| | | } |
New file |
| | |
| | | package com.dsh.communityWorldCup.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2024/3/12 17:51 |
| | | */ |
| | | @Data |
| | | public class GetWorldCupPayment { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Map<String, Object> userGameRecordList(UserGameRecordList userGameRecordList); |
| | | |
| | | |
| | | /** |
| | | * 获取比赛场次 |
| | | * @param worldCupId |
| | | * @return |
| | | */ |
| | | int getMatchTime(Integer worldCupId); |
| | | } |
| | |
| | | matchRecord.setPageNo(pageNo); |
| | | MatchRecordVo matchRecordVo = new MatchRecordVo(); |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("participantId", matchRecord.getId()) |
| | | .eq("participantType", matchRecord.getIsStudent())); |
| | | .eq("participantType", matchRecord.getIsStudent()).isNotNull("matchResult")); |
| | | matchRecordVo.setTotalSession(count); |
| | | List<MatchRecordList> matchRecord1 = this.baseMapper.getMatchRecord(matchRecord); |
| | | matchRecordVo.setList(matchRecord1); |
| | |
| | | } |
| | | //参赛人员 |
| | | if(participantType == 2){ |
| | | AppUser appUser1 = appUserClient.getAppUser(appUserId); |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | worldCupRankVo.setAvatar(appUser1.getHeadImg()); |
| | | worldCupRankVo.setAvatar(participant.getHeadImg()); |
| | | String name = participant.getName(); |
| | | if(name.length() > 2){ |
| | | name = name.charAt(0) + "*" + name.substring(2); |
| | |
| | | } |
| | | //参赛人员 |
| | | if(participantType == 2){ |
| | | AppUser appUser1 = appUserClient.getAppUser(appUserId); |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | worldCupRankVo.setAvatar(appUser1.getHeadImg()); |
| | | worldCupRankVo.setAvatar(participant.getHeadImg()); |
| | | String name = participant.getName(); |
| | | if(name.length() > 2){ |
| | | name = name.charAt(0) + "*" + name.substring(2); |
| | |
| | | if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){ |
| | | if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(idcard) && tStudent.getIdCard().indexOf(idcard) == -1){ |
| | |
| | | |
| | | map.put("name", tStudent.getName()); |
| | | map.put("phone", ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()); |
| | | map.put("idcard", tStudent.getIdCard()); |
| | | }else{ |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){ |
| | | if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(idcard) && participant.getIdcard().indexOf(idcard) == -1){ |
| | |
| | | |
| | | map.put("name", participant.getName()); |
| | | map.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()); |
| | | map.put("idcard", participant.getIdcard()); |
| | | } |
| | | list.add(map); |
| | | } |
| | | map1.put("total", mapList.size()); |
| | | map1.put("total", list.size()); |
| | | Integer offset = worldCupGameStatisticsInfoList.getOffset(); |
| | | Integer limit = worldCupGameStatisticsInfoList.getLimit(); |
| | | limit += offset; |
| | | map1.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size())); |
| | | map1.put("rows", list.subList(offset, list.size() >= limit ? limit : list.size())); |
| | | return map1; |
| | | } |
| | | |
| | |
| | | } |
| | | map.put("userName", participant.getName()); |
| | | } |
| | | map.put("score", ourScore.compareTo(opponentScore) > 0 ? |
| | | ourScore + ":" + opponentScore : |
| | | opponentScore + ":" + ourScore); |
| | | map.put("score", ourScore + ":" + opponentScore); |
| | | map.put("matchResult", matchResult == 1 ? "胜" : matchResult == 0 ? "平" :"负"); |
| | | mapList.add(map); |
| | | } |
| | |
| | | map.put("rows", mapList.subList(offset, mapList.size() >= limit ? limit : mapList.size())); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取比赛场次 |
| | | * @param worldCupId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int getMatchTime(Integer worldCupId) { |
| | | return this.baseMapper.getMatchTime(worldCupId); |
| | | } |
| | | } |
| | |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | participantVo.setId(participant.getId()); |
| | | participantVo.setName(participant.getName()); |
| | | participantVo.setAvatar(appUser.getHeadImg()); |
| | | participantVo.setAvatar(participant.getHeadImg()); |
| | | int age = Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(participant.getBirthday())); |
| | | participantVo.setAge(age); |
| | | participantVo.setIdcard(participant.getIdcard()); |
| | |
| | | for (WorldCupPaymentParticipant on : list1) { |
| | | WorldCupPayment worldCupPayment = worldCupPaymentService.getById(on.getWorldCupPaymentId()); |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | AppUser appUser = appUserClient.getAppUser(on.getAppUserId()); |
| | | if(on.getParticipantType() == 1){ |
| | | TStudent tStudent = studentClient.queryById(on.getParticipantId().intValue()); |
| | | if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){ |
| | | if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(idcode) && tStudent.getIdCard().indexOf(idcode) == -1){ |
| | |
| | | map1.put("name", tStudent.getName()); |
| | | map1.put("gender", tStudent.getSex() == 1 ? "男" : "女"); |
| | | map1.put("age", Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(tStudent.getBirthday()))); |
| | | map1.put("phone", tStudent.getPhone()); |
| | | map1.put("phone", ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()); |
| | | map1.put("idcard", tStudent.getIdCard()); |
| | | map1.put("state", worldCupPayment.getPayStatus() - 1); |
| | | }else{ |
| | |
| | | if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){ |
| | | if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(idcode) && participant.getIdcard().indexOf(idcode) == -1){ |
| | |
| | | map1.put("name", participant.getName()); |
| | | map1.put("gender", participant.getGender() == 1 ? "男" : "女"); |
| | | map1.put("age", Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(participant.getBirthday()))); |
| | | map1.put("phone", participant.getPhone()); |
| | | map1.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()); |
| | | map1.put("idcard", participant.getIdcard()); |
| | | map1.put("state", worldCupPayment.getPayStatus() - 1); |
| | | } |
| | |
| | | if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){ |
| | | if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(idcard) && tStudent.getIdCard().indexOf(idcard) == -1){ |
| | |
| | | if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){ |
| | | if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){ |
| | | continue; |
| | | } |
| | | if(ToolUtil.isNotEmpty(idcard) && participant.getIdcard().indexOf(idcard) == -1){ |
| | |
| | | //开始处理退款 |
| | | //免费 |
| | | if(worldCupPayment.getPayType() == 0){ |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | } |
| | | if("10000".equals(map.get("code"))){ |
| | | String trade_no = map.get("trade_no"); |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(trade_no); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | AppUser appUser = appUserClient.getAppUser(appUserId); |
| | | appUser.setPlayPaiCoins(appUser.getPlayPaiCoins() + multiply.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | DeductionClassHourList deductionClassHourList = JSON.parseObject(content, DeductionClassHourList.class); |
| | | coursePackageOrderStudentClient.backspaceClassHour(deductionClassHourList); |
| | | } |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | |
| | | String people = startWorldCup.getPeople(); |
| | | JSONArray jsonArray = JSON.parseArray(people); |
| | | if(jsonArray.size() != 6){ |
| | | return ResultUtil.error("参赛人数只能是6人"); |
| | | } |
| | | String timeStr = UUIDUtil.getTimeStr() + UUIDUtil.getNumberRandom(3); |
| | | List<Long> ids = new ArrayList<>(); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | |
| | | |
| | | String cupIds = paymentWorldCup.getIds(); |
| | | JSONArray jsonArray = JSON.parseArray(cupIds); |
| | | if(jsonArray.size() != 6){ |
| | | return ResultUtil.error("参赛人数只能是6人"); |
| | | } |
| | | List<WorldCupPayment> payments = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", worldCup.getId()) |
| | | .eq("payStatus", 2).eq("state", 1)); |
| | | List<Long> ids = payments.stream().map(WorldCupPayment::getId).collect(Collectors.toList()); |
| | |
| | | |
| | | appUser.setPlayPaiCoins(appUser.getPlayPaiCoins() - multiply.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | // |
| | | |
| | | //添加报名明细 |
| | | String ids = paymentWorldCup.getIds(); |
| | |
| | | BigDecimal multiply = worldCupPayment.getUnitPrice().multiply(new BigDecimal(list1.size())); |
| | | //免费 |
| | | if(worldCupPayment.getPayType() == 0){ |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | } |
| | | if("10000".equals(map.get("code"))){ |
| | | String trade_no = map.get("trade_no"); |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(trade_no); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | AppUser appUser = appUserClient.getAppUser(appUserId); |
| | | appUser.setPlayPaiCoins(appUser.getPlayPaiCoins() + multiply.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | DeductionClassHourList deductionClassHourList = JSON.parseObject(content, DeductionClassHourList.class); |
| | | coursePackageOrderStudentClient.backspaceClassHour(deductionClassHourList); |
| | | } |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | |
| | | List<Map<String, Object>> mapList = this.baseMapper.worldCupGameStatistics(worldCupGameStatistics); |
| | | for (Map<String, Object> stringObjectMap : mapList) { |
| | | Integer id = Integer.valueOf(stringObjectMap.get("id").toString()); |
| | | int count = worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>().eq("worldCupId", id)); |
| | | int count = worldCupCompetitorService.getMatchTime(id); |
| | | stringObjectMap.put("matchTime", count); |
| | | |
| | | List<WorldCupPayment> list = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", id) |
| | |
| | | participantId, |
| | | count(*) as num |
| | | from t_world_cup_competitor |
| | | where DATE_FORMAT(NOW(), '%Y') = DATE_FORMAT(startTime, '%Y') |
| | | where matchResult is not null and DATE_FORMAT(NOW(), '%Y') = DATE_FORMAT(startTime, '%Y') |
| | | <if test="null != appUserIds and appUserIds.size() > 0"> |
| | | and appUserId in |
| | | <foreach collection="appUserIds" item="item" index="index" open="(" separator="," close=")"> |
| | |
| | | </foreach> |
| | | </if> |
| | | group by participantType, participantId |
| | | ) as aa order by aa.num desc |
| | | ) as aa order by aa.num desc,aa.participantId |
| | | </select> |
| | | |
| | | |
| | |
| | | (a.participationIntegral + a.winIntegral) as award |
| | | from t_world_cup_competitor a |
| | | left join t_world_cup b on (a.worldCupId = b.id) |
| | | where a.participantId = #{item.id} and a.participantType = #{item.isStudent} |
| | | where a.matchResult is not null and a.participantId = #{item.id} and a.participantType = #{item.isStudent} |
| | | order by a.startTime desc limit #{item.pageNo}, #{item.pageSize} |
| | | </select> |
| | | |
| | |
| | | ) as b on (a.participantId = b.participantId and a.participantType = b.participantType) |
| | | ) as aa |
| | | <if test="null != item.sort and item.sort == 1"> |
| | | order by aa.totalSession desc |
| | | order by aa.totalSession desc,aa.participantId |
| | | </if> |
| | | <if test="null != item.sort and item.sort == 2"> |
| | | order by aa.winRate desc |
| | | order by aa.winRate desc,aa.participantId |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | group by participantType, participantId, appUserId |
| | | ) as b on (a.participantId = b.participantId and a.participantType = b.participantType) |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="getMatchTime" resultType="int"> |
| | | select count(*) as matchTime from (select code from t_world_cup_competitor where worldCupId = #{worldCupId} group by code) as b |
| | | </select> |
| | | </mapper> |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil delParticipant(Integer id) { |
| | | public ResultUtil delParticipant(Integer id, Integer isStudent) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return participantService.delParticipant(id); |
| | | return participantService.delParticipant(id, isStudent); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @TableField("headImg") |
| | | private String headImg; |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @TableField("birthday") |
| | |
| | | public class AddParticipant { |
| | | @ApiModelProperty(value = "姓名", dataType = "string", required = true) |
| | | private String name; |
| | | @ApiModelProperty(value = "头像", dataType = "string", required = true) |
| | | private String headImg; |
| | | @ApiModelProperty(value = "生日", dataType = "string", required = true) |
| | | private String birthday; |
| | | @ApiModelProperty(value = "性别(1=男,2=女)", dataType = "int", required = true) |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil delParticipant(Integer id) throws Exception; |
| | | ResultUtil delParticipant(Integer id, Integer isStudent) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil delParticipant(Integer id) throws Exception { |
| | | Participant participant = this.getById(id); |
| | | participant.setState(3); |
| | | this.updateById(participant); |
| | | public ResultUtil delParticipant(Integer id, Integer isStudent) throws Exception { |
| | | if(isStudent == 1){ |
| | | TStudent tStudent = studentClient.queryById(id); |
| | | tStudent.setState(3); |
| | | studentClient.updateAppUser(tStudent); |
| | | }else{ |
| | | Participant participant = this.getById(id); |
| | | participant.setState(3); |
| | | this.updateById(participant); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | import com.dsh.other.service.IHomeModuleService; |
| | | import com.dsh.other.service.StoreConfigService; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import com.dsh.other.util.ToolUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | StoreConfigVo vo = new StoreConfigVo(); |
| | | vo.setType(0); |
| | | vo.setIsOpen(homeModule.getIsOpen()); |
| | | vo.setIsTop(homeModule.getIsTop()); |
| | | vo.setSort(homeModule.getSort()); |
| | | vo.setBackgroundImage(homeModule.getBackgroundImage()); |
| | | listVo.add(vo); |
| | | } |
| | | for (StoreConfig storeConfig : list) { |
| | | StoreConfigVo storeConfigVo = new StoreConfigVo(); |
| | | storeConfigVo.setIsTop(0); |
| | | BeanUtils.copyProperties(storeConfig, storeConfigVo); |
| | | if (!StringUtils.hasLength(storeConfig.getBackgroundImage())) { |
| | | switch (storeConfigVo.getType()) { |
| | |
| | | List<WorldCupStore> worldCupStoreList = worldCupStoreClient.getWorldCupStoreList(storeId); |
| | | for (WorldCupStore worldCupStore : worldCupStoreList) { |
| | | StoreConfigVo storeConfigVo = new StoreConfigVo(); |
| | | storeConfigVo.setIsTop(0); |
| | | storeConfigVo.setId(worldCupStore.getWorldCupId()); |
| | | storeConfigVo.setBackgroundImage(worldCupStore.getBackgroundImage()); |
| | | storeConfigVo.setBackgroundImage(ToolUtil.isNotEmpty(worldCupStore.getBackgroundImage()) ? worldCupStore.getBackgroundImage() : "https://we-park-life.oss-cn-beijing.aliyuncs.com/img/760934115ff6468591ed51f0d760a989.jpg"); |
| | | storeConfigVo.setType(9); |
| | | storeConfigVo.setIsOpen(worldCupStore.getIsOpen()); |
| | | storeConfigVo.setSort(worldCupStore.getSort()); |
| | |
| | | return o1.getSort().compareTo(o2.getSort()); |
| | | } |
| | | }); |
| | | //排序 |
| | | Collections.sort(listVo, new Comparator<StoreConfigVo>() { |
| | | @Override |
| | | public int compare(StoreConfigVo o1, StoreConfigVo o2) { |
| | | return o1.getIsTop().compareTo(o2.getIsTop()) * -1; |
| | | } |
| | | }); |
| | | for (int i = 0; i < listVo.size(); i++) { |
| | | listVo.get(i).setSort(i + 1); |
| | | } |
| | | return ResultUtil.success(listVo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | private Integer type; |
| | | @ApiModelProperty("是否开启(0=否,1=是)") |
| | | private Integer isOpen; |
| | | @ApiModelProperty("置顶(0=否,1=是)") |
| | | private Integer isTop; |
| | | @ApiModelProperty("排序") |
| | | private Integer sort; |
| | | @ApiModelProperty("背景图") |