| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/referee/getRefereeByPhone") |
| | | public Referee getRefereeByPhone(String phone){ |
| | | public Referee getRefereeByPhone(@RequestBody String phone){ |
| | | return refereeService.getOne(new QueryWrapper<Referee>() |
| | | .eq("phone", phone).ne("state", 3)); |
| | | } |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数) |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | /** |
| | | * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时) |
| | | */ |
| | | private Integer payType; |
| | | private String payType; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | |
| | | public class HonorRules { |
| | | private Integer id; |
| | | /** |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数) |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | |
| | | */ |
| | | private String refundOrderNo; |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | @TableField("refundAmount") |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | |
| | | @Data |
| | | public class GongVo { |
| | | |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)") |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇)") |
| | | private Integer medalType; |
| | | |
| | | @ApiModelProperty(value = "勋章名称 例如:俱乐部之星") |
| | |
| | | @Data |
| | | public class StuMedalVo { |
| | | |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)") |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇)") |
| | | private Integer medalType; |
| | | |
| | | @ApiModelProperty(value = "勋章名称 例如:俱乐部之星") |
| | |
| | | //世界杯 |
| | | GetWorldCupPayment getWorldCupPayment = new GetWorldCupPayment(); |
| | | getWorldCupPayment.setAppUserId(appUserId); |
| | | getWorldCupPayment.setPayType(3); |
| | | 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.setConsumeName(RechargeRecordEnum.WORLD_CIP_PAYMENT.getMsg()); |
| | | 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.setConsumeName(RechargeRecordEnum.CANCEL_WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("+" + cupPayment.getAmount()); |
| | | consumeDetail.setConsumeAmount("+" + cupPayment.getRefundAmount()); |
| | | consumeDetail.setRecordId(1); |
| | | } |
| | | details.add(consumeDetail); |
| | |
| | | if (count5 > 0) { |
| | | GongVo vo = new GongVo(); |
| | | vo.setMedalType(5); |
| | | vo.setMedalName("赢家"); |
| | | vo.setMedalName("常胜将军"); |
| | | voList.add(vo); |
| | | } |
| | | |
| | |
| | | if (count6 > 0) { |
| | | GongVo vo = new GongVo(); |
| | | vo.setMedalType(6); |
| | | vo.setMedalName("次数"); |
| | | vo.setMedalName("越战越勇"); |
| | | voList.add(vo); |
| | | } |
| | | |
| | |
| | | vo.setMedalName("深度玩家"); |
| | | break; |
| | | case 5: |
| | | vo.setMedalName("赢家"); |
| | | vo.setMedalName("常胜将军"); |
| | | break; |
| | | case 6: |
| | | vo.setMedalName("次数"); |
| | | vo.setMedalName("越战越勇"); |
| | | break; |
| | | } |
| | | //拿到当前对应的rule对象 |
| | |
| | | import com.dsh.account.enums.RechargeRecordEnum; |
| | | import com.dsh.account.feignclient.activity.*; |
| | | import com.dsh.account.feignclient.activity.model.*; |
| | | 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.BillingDataRequestVo; |
| | | import com.dsh.account.feignclient.course.CoursePackageClient; |
| | |
| | | |
| | | @Autowired |
| | | private IRefereeService refereeService; |
| | | |
| | | @Resource |
| | | private WorldCupPaymentClinet worldCupPaymentClinet; |
| | | |
| | | |
| | | |
| | |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | |
| | | //世界杯 |
| | | GetWorldCupPayment getWorldCupPayment = new GetWorldCupPayment(); |
| | | getWorldCupPayment.setAppUserId(appUserId); |
| | | getWorldCupPayment.setPayType("1,2"); |
| | | getWorldCupPayment.setStartTime(monthStart); |
| | | getWorldCupPayment.setEndTime(monthEnd); |
| | | List<WorldCupPayment> worldCupPayment = worldCupPaymentClinet.getWorldCupPayment(getWorldCupPayment); |
| | | for (WorldCupPayment cupPayment : worldCupPayment) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | if(cupPayment.getPayStatus() != 3){ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("-" + cupPayment.getAmount()); |
| | | consumeDetail.setType(2); |
| | | }else{ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("+" + cupPayment.getRefundAmount()); |
| | | consumeDetail.setType(1); |
| | | } |
| | | details.add(consumeDetail); |
| | | } |
| | | |
| | | return details; |
| | | } |
| | | |
| | |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | private String appid = "";//微信appid |
| | | |
| | | private String appletsAppid = "";//微信小程序appid |
| | | private String smid = "2088330203191220";//平台支付宝商户号 |
| | | |
| | | private String mchId = "";//微信商户号 |
| | | private String appid = "wx41d32f362ba0f911";//微信appid |
| | | |
| | | private String key = "";//微信商户号 |
| | | private String appSecret = "cf0ebf950f5926a69041a0e2bbe20f3e"; |
| | | |
| | | private String mchId = "1501481761";//微信商户号 |
| | | |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "http://221.182.45.100:56666/account";//支付回调网关地址 |
| | | |
| | |
| | | } |
| | | String nonce_str = UUIDUtil.getRandomCode(16); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appid", "APP".equals(tradeType) ? appid : appletsAppid); |
| | | map.put("appid", appid); |
| | | map.put("mch_id", mchId); |
| | | map.put("nonce_str", nonce_str); |
| | | map.put("body", body); |
| | |
| | | and provinceCode = #{item.provinceCode} |
| | | </if> |
| | | <if test="null != item.cityCode and '' != item.cityCode"> |
| | | and cityCode = #{cityCode} |
| | | and cityCode = #{item.cityCode} |
| | | </if> |
| | | order by createTime desc limit #{item.offset}, #{item.limit} |
| | | </select> |
| | |
| | | and provinceCode = #{item.provinceCode} |
| | | </if> |
| | | <if test="null != item.cityCode and '' != item.cityCode"> |
| | | and cityCode = #{cityCode} |
| | | and cityCode = #{item.cityCode} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | String endTime = (String) stringObjectMap.get("endTime"); |
| | | stringObjectMap.put("timeValue", startTime + "至" + endTime); |
| | | int count1 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, o)); |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, o) |
| | | .eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1)); |
| | | int count2 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, o) |
| | | .eq(UserPointsMerchandise::getStatus, 2)); |
| | | .eq(UserPointsMerchandise::getStatus, 2) |
| | | .eq(UserPointsMerchandise::getPayStatus, 2).eq(UserPointsMerchandise::getState, 1)); |
| | | stringObjectMap.put("hasExchangeQty", count1); |
| | | stringObjectMap.put("hasPickQty", count2); |
| | | |
| | |
| | | import com.dsh.communityWorldCup.feignclient.account.model.TStudent; |
| | | import com.dsh.communityWorldCup.feignclient.competition.ParticipantClient; |
| | | import com.dsh.communityWorldCup.feignclient.competition.model.Participant; |
| | | import com.dsh.communityWorldCup.feignclient.other.GameClient; |
| | | import com.dsh.communityWorldCup.feignclient.other.SiteClient; |
| | | import com.dsh.communityWorldCup.feignclient.other.StoreClient; |
| | | import com.dsh.communityWorldCup.feignclient.other.model.Site; |
| | | import com.dsh.communityWorldCup.feignclient.other.model.Store; |
| | | import com.dsh.communityWorldCup.feignclient.other.model.TGame; |
| | | import com.dsh.communityWorldCup.model.*; |
| | | import com.dsh.communityWorldCup.service.*; |
| | | import com.dsh.communityWorldCup.util.GDMapGeocodingUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IWorldCupPaymentService worldCupPaymentService; |
| | | |
| | | @Resource |
| | | private GameClient gameClient; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据门店id获取门店关系数据 |
| | |
| | | .eq("worldCupId", worldCupPeople.getWorldCupId()).eq("participantId", id).eq("participantType", isStudent) |
| | | .orderByDesc("createTime").last(" limit 0, 1")); |
| | | if(null == worldCupPaymentParticipant){ |
| | | return ResultUtil.error("无效二维码"); |
| | | return ResultUtil.error("报名失败,当前用户未报名当前比赛"); |
| | | } |
| | | WorldCupPeopleVo worldCupPeopleVo = new WorldCupPeopleVo(); |
| | | worldCupPeopleVo.setId(worldCupPaymentParticipant.getParticipantId()); |
| | |
| | | if(null == store){ |
| | | return ResultUtil.error("无法获取场地信息"); |
| | | } |
| | | String sutu_id = jsonObject.getString("sutu_id"); |
| | | TGame tGame = gameClient.getTGameBySutuId(sutu_id); |
| | | if(null == tGame){ |
| | | return ResultUtil.error("无效的游戏二维码"); |
| | | } |
| | | Site site = siteClient.getSite(tGame.getSiteId()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("name", store.getName()); |
| | | map.put("address", store.getAddress()); |
| | | map.put("address", site.getName()); |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | |
| | | if(null != map){ |
| | | String code = map.get("out_trade_no"); |
| | | String transaction_id = map.get("trade_no"); |
| | | String result = map.get("result"); |
| | | ResultUtil resultUtil = worldCupService.paymentWorldCupCallback(code, transaction_id); |
| | | if(resultUtil.getCode() == 200){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.println(result); |
| | | out.println("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | }else{ |
| | |
| | | @PostMapping("/api/worldCup/getMyWorldCupInfo") |
| | | @ApiOperation(value = "获取已报名世界杯详情【2.0】", tags = {"APP-个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "列表中的id", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "id", value = "列表中的id", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "lon", value = "经度", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "lat", value = "纬度", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<MyWorldCupInfo> getMyWorldCupInfo(String id, String lon, String lat){ |
| | | public ResultUtil<MyWorldCupInfo> getMyWorldCupInfo(Long id, String lon, String lat){ |
| | | MyWorldCupInfo myWorldCupInfo = worldCupPaymentParticipantService.getMyWorldCupInfo(id, lon, lat); |
| | | return ResultUtil.success(myWorldCupInfo); |
| | | } |
| | |
| | | @PostMapping("/api/worldCup/cancelMyWorldCup") |
| | | @ApiOperation(value = "取消已报名的世界杯【2.0】", tags = {"APP-个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "列表中的id", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "id", value = "列表中的id", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil cancelMyWorldCup(String id){ |
| | | public ResultUtil cancelMyWorldCup(Long id){ |
| | | return worldCupPaymentService.cancelMyWorldCup(id); |
| | | } |
| | | |
| | |
| | | worldCupPayment.setRefundOrderNo(refund_id); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | PrintWriter out = null; |
| | | try { |
| | |
| | | @PostMapping("/worldCup/getWorldCupPayment") |
| | | public List<WorldCupPayment> getWorldCupPayment(@RequestBody GetWorldCupPayment getWorldCupPayment){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String payType = getWorldCupPayment.getPayType(); |
| | | return worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("appUserId", getWorldCupPayment.getAppUserId()) |
| | | .eq("payType", getWorldCupPayment.getPayType()).ne("payStatus", 1).eq("state", 1) |
| | | .in("payType", Arrays.asList(payType.split(","))).ne("payStatus", 1).eq("state", 1) |
| | | .last(" and createTime between '" + sdf.format(getWorldCupPayment.getStartTime()) + "' and '" + sdf.format(getWorldCupPayment.getEndTime()) + "' order by createTime desc")); |
| | | } |
| | | } |
| | |
| | | @TableField("refundOrderNo") |
| | | private String refundOrderNo; |
| | | /** |
| | | * 退款金额 |
| | | */ |
| | | @TableField("refundAmount") |
| | | private BigDecimal refundAmount; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
New file |
| | |
| | | package com.dsh.communityWorldCup.feignclient.account; |
| | | |
| | | import com.dsh.communityWorldCup.feignclient.account.model.StudentHonor; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * 勋章 |
| | | */ |
| | | @FeignClient("mb-cloud-account") |
| | | public interface StudentHonorClient { |
| | | |
| | | |
| | | /** |
| | | * 保存用户勋章 |
| | | * @param studentHonor |
| | | */ |
| | | @PostMapping("/studentHonor/saveStudentHonor") |
| | | void saveStudentHonor(StudentHonor studentHonor); |
| | | } |
New file |
| | |
| | | package com.dsh.communityWorldCup.feignclient.account.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StudentHonor { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 荣耀类型 |
| | | */ |
| | | private Integer honorType; |
| | | /** |
| | | * 当前次数 |
| | | */ |
| | | private Integer number; |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 根据学院id获取剩余有效课时数据 |
| | | * 根据学员id获取剩余有效课时数据 |
| | | * @param studentId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 根据用户id获取剩余有效课时数据 |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageOrderStudent/getCoursePackageOrderUser") |
| | | List<CoursePackageOrderStudent> getCoursePackageOrderUser(Integer appUserId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 扣减学员课时 |
| | | * @param deductionClassHourList |
| | | */ |
| | |
| | | /** |
| | | * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时) |
| | | */ |
| | | private Integer payType; |
| | | private String payType; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | |
| | | @ApiModel |
| | | public class MyWorldCupInfo { |
| | | @ApiModelProperty("世界杯id") |
| | | private Integer id; |
| | | private Long id; |
| | | @ApiModelProperty("图片") |
| | | private String infoImg; |
| | | @ApiModelProperty("名称") |
| | |
| | | private Integer status; |
| | | private String lon; |
| | | private String lat; |
| | | private Double distance; |
| | | } |
| | |
| | | @ApiModel |
| | | public class WorldCupRank { |
| | | @ApiModelProperty(value = "参赛人id", required = true, dataType = "int") |
| | | private Integer id; |
| | | private Long id; |
| | | @ApiModelProperty(value = "是否是学员", required = true, dataType = "int") |
| | | private Integer isStudent; |
| | | @ApiModelProperty(value = "年份,2024", required = false, dataType = "int") |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MyWorldCupInfo getMyWorldCupInfo(String id, String lon, String lat); |
| | | MyWorldCupInfo getMyWorldCupInfo(Long id, String lon, String lat); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ResultUtil cancelMyWorldCup(String id); |
| | | ResultUtil cancelMyWorldCup(Long id); |
| | | } |
| | |
| | | import com.dsh.communityWorldCup.entity.WorldCupCompetitor; |
| | | import com.dsh.communityWorldCup.feignclient.account.AppUserClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.StudentClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.StudentHonorClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.UserIntegralChangesClient; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.AppUser; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.AppUserIdsByCityName; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.SaveUserIntegralChangesVo; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.TStudent; |
| | | import com.dsh.communityWorldCup.feignclient.account.model.*; |
| | | import com.dsh.communityWorldCup.feignclient.competition.ParticipantClient; |
| | | import com.dsh.communityWorldCup.feignclient.competition.model.Participant; |
| | | import com.dsh.communityWorldCup.feignclient.other.StoreClient; |
| | |
| | | |
| | | @Resource |
| | | private UserIntegralChangesClient userIntegralChangesClient; |
| | | |
| | | @Resource |
| | | private StudentHonorClient studentHonorClient; |
| | | |
| | | |
| | | |
| | |
| | | worldCupRankVo.setName(name); |
| | | |
| | | } |
| | | if(worldCupRank.getIsStudent().equals(participantType) && worldCupRank.getId().equals(participantId)){ |
| | | if(worldCupRank.getIsStudent().compareTo(participantType) == 0 && worldCupRank.getId().compareTo(participantId) == 0){ |
| | | worldCupRankVo.setOneself(1); |
| | | b = true; |
| | | }else{ |
| | |
| | | } |
| | | //排名前20的数据添加完成后且包含自己,需要将自己找出来后添加到21位 |
| | | if(i > 19 && !b){ |
| | | if(worldCupRank.getIsStudent().equals(participantType) && worldCupRank.getId().equals(participantId)){ |
| | | if(worldCupRank.getIsStudent().compareTo(participantType) == 0 && worldCupRank.getId().compareTo(participantId) == 0){ |
| | | WorldCupRankVo worldCupRankVo = new WorldCupRankVo(); |
| | | worldCupRankVo.setRank(i + 1); |
| | | worldCupRankVo.setTotalSession(totalSession); |
| | |
| | | } |
| | | |
| | | this.updateBatchById(worldCupCompetitors); |
| | | |
| | | //添加勋章 |
| | | for (WorldCupCompetitor worldCupCompetitor : worldCupCompetitors) { |
| | | Integer appUserId = worldCupCompetitor.getAppUserId(); |
| | | //常胜将军 |
| | | if(1 == worldCupCompetitor.getMatchResult()){ |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId).eq("matchResult", 1)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(5); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | //越战越勇 |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(6); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | if(1 == participantType){ |
| | | TStudent tStudent = studentClient.queryById(participantId.intValue()); |
| | | map.put("name", tStudent.getName()); |
| | | map.put("phone", tStudent.getPhone()); |
| | | map.put("phone", ToolUtil.isNotEmpty(tStudent.getPhone()) ? tStudent.getPhone() : appUser.getPhone()); |
| | | }else{ |
| | | Participant participant = participantClient.getParticipant(participantId); |
| | | map.put("name", participant.getName()); |
| | | map.put("phone", participant.getPhone()); |
| | | map.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()); |
| | | } |
| | | } |
| | | Integer offset = worldCupRecords.getOffset(); |
| | |
| | | cupCompetitor.setOpponentScore(blue); |
| | | } |
| | | this.updateBatchById(blueList); |
| | | |
| | | |
| | | //修改勋章 |
| | | List<WorldCupCompetitor> worldCupCompetitors = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode())); |
| | | for (WorldCupCompetitor wcc : worldCupCompetitors) { |
| | | Integer appUserId = wcc.getAppUserId(); |
| | | //常胜将军 |
| | | if(1 == wcc.getMatchResult()){ |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId).eq("matchResult", 1)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(5); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | //越战越勇 |
| | | int count = this.count(new QueryWrapper<WorldCupCompetitor>().eq("appUserId", appUserId)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(6); |
| | | studentHonor.setNumber(count); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MyWorldCupInfo getMyWorldCupInfo(String id, String lon, String lat) { |
| | | public MyWorldCupInfo getMyWorldCupInfo(Long id, String lon, String lat) { |
| | | WorldCupPaymentParticipant worldCupPaymentParticipant = this.getById(id); |
| | | Integer worldCupId = worldCupPaymentParticipant.getWorldCupId(); |
| | | WorldCupPayment worldCupPayment = worldCupPaymentService.getById(worldCupPaymentParticipant.getWorldCupPaymentId()); |
| | |
| | | WorldCup worldCup = worldCupService.getById(worldCupId); |
| | | MyWorldCupInfo myWorldCupInfo = new MyWorldCupInfo(); |
| | | BeanUtils.copyProperties(worldCupInfo, myWorldCupInfo); |
| | | myWorldCupInfo.setId(worldCupPaymentParticipant.getId()); |
| | | myWorldCupInfo.setUnitPrice(worldCupPayment.getUnitPrice().doubleValue()); |
| | | myWorldCupInfo.setExpense(worldCupPayment.getAmount().doubleValue()); |
| | | myWorldCupInfo.setStatus(worldCup.getStatus()); |
| | |
| | | objects.add(map); |
| | | } |
| | | worldCupInfo.setStoreInfos(objects); |
| | | String address = worldCupInfo.getAddress(); |
| | | String province = worldCupInfo.getProvince(); |
| | | String city = worldCupInfo.getCity(); |
| | | int index = address.indexOf("市"); |
| | | if(index != -1){ |
| | | address = address.substring(index + 1); |
| | | worldCupInfo.setAddress(address); |
| | | } |
| | | index = province.indexOf("省"); |
| | | if(index != -1){ |
| | | province = province.substring(0, index - 1); |
| | | worldCupInfo.setProvince(province); |
| | | } |
| | | index = city.indexOf("市"); |
| | | if(index != -1){ |
| | | city = city.substring(0, index - 1); |
| | | worldCupInfo.setCity(city); |
| | | } |
| | | return myWorldCupInfo; |
| | | } |
| | | |
| | |
| | | .eq("payStatus", 2).eq("state", 1)); |
| | | List<Long> collect = list.stream().map(WorldCupPayment::getId).collect(Collectors.toList()); |
| | | List<ParticipantVo> datas = new ArrayList<>(); |
| | | Set<Integer> csry = new HashSet<>(); |
| | | Set<Integer> xy = new HashSet<>(); |
| | | Set<Long> csry = new HashSet<>(); |
| | | Set<Long> xy = new HashSet<>(); |
| | | if(collect.size() > 0){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | List<WorldCupPaymentParticipant> list1 = this.list(new QueryWrapper<WorldCupPaymentParticipant>().in("worldCupPaymentId", collect)); |
| | |
| | | participantVo.setPhone(tStudent.getPhone()); |
| | | participantVo.setIsStudent(1); |
| | | datas.add(participantVo); |
| | | xy.add(participantId); |
| | | } |
| | | //参赛人员 |
| | | if(2 == participantType && !csry.contains(participantId)){ |
| | |
| | | participantVo.setPhone(participant.getPhone()); |
| | | participantVo.setIsStudent(0); |
| | | datas.add(participantVo); |
| | | csry.add(participantId); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil cancelMyWorldCup(String id) { |
| | | public ResultUtil cancelMyWorldCup(Long id) { |
| | | WorldCupPaymentParticipant worldCupPaymentParticipant = worldCupPaymentParticipantService.getById(id); |
| | | WorldCupPayment worldCupPayment = this.getById(worldCupPaymentParticipant.getWorldCupPaymentId()); |
| | | WorldCup worldCup = worldCupService.getById(worldCupPayment.getWorldCupId()); |
| | |
| | | } |
| | | List<WorldCupPaymentParticipant> list1 = worldCupPaymentParticipantService.list(new QueryWrapper<WorldCupPaymentParticipant>() |
| | | .eq("worldCupPaymentId", worldCupPayment.getId()).eq("alreadyEntered", 0)); |
| | | //总排款金额(排除已经参加比赛的数据) |
| | | BigDecimal multiply = worldCupPayment.getUnitPrice().multiply(new BigDecimal(list1.size())); |
| | | //微信支付 |
| | | if(worldCupPayment.getPayType() == 1){ |
| | |
| | | System.err.println("-------------微信退款失败---------"); |
| | | System.err.println(map.get("return_msg")); |
| | | return ResultUtil.error("微信退款失败"); |
| | | }else{ |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | this.updateById(worldCupPayment); |
| | | } |
| | | } |
| | | //支付宝支付 |
| | |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(trade_no); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | this.updateById(worldCupPayment); |
| | | } |
| | | } |
| | |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | this.updateById(worldCupPayment); |
| | | } |
| | | //课时支付 |
| | |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | this.updateById(worldCupPayment); |
| | | } |
| | | return ResultUtil.success(); |
| | |
| | | @Override |
| | | public List<WorldCupListCoachVo> getWorldCupListCoach(WorldCupListCoach worldCupListCoach) { |
| | | List<WorldCupListCoachVo> worldCupListCoach1 = this.baseMapper.getWorldCupListCoach(worldCupListCoach); |
| | | for (WorldCupListCoachVo worldCupListCoachVo : worldCupListCoach1) { |
| | | String lat = worldCupListCoachVo.getLat(); |
| | | String lon = worldCupListCoachVo.getLon(); |
| | | if(ToolUtil.isNotEmpty(worldCupListCoach.getLon()) && ToolUtil.isNotEmpty(worldCupListCoach.getLat())){ |
| | | Map<String, Double> distance2 = GeodesyUtil.getDistance(lon + "," + lat, worldCupListCoach.getLon() + "," + worldCupListCoach.getLat()); |
| | | Double wgs842 = distance2.get("WGS84"); |
| | | worldCupListCoachVo.setDistance(wgs842); |
| | | }else{ |
| | | worldCupListCoachVo.setDistance(0D); |
| | | } |
| | | } |
| | | //对查询结果进行距离排序(直线距离) |
| | | Collections.sort(worldCupListCoach1, new Comparator<WorldCupListCoachVo>() { |
| | | @Override |
| | | public int compare(WorldCupListCoachVo o1, WorldCupListCoachVo o2) { |
| | | Map<String, Double> distance1 = GeodesyUtil.getDistance(o1.getLon() + "," + o1.getLat(), worldCupListCoach.getLon() + "," + worldCupListCoach.getLat()); |
| | | Double wgs841 = distance1.get("WGS84"); |
| | | Map<String, Double> distance2 = GeodesyUtil.getDistance(o2.getLon() + "," + o2.getLat(), worldCupListCoach.getLon() + "," + worldCupListCoach.getLat()); |
| | | Double wgs842 = distance2.get("WGS84"); |
| | | return wgs841.compareTo(wgs842); |
| | | return o1.getDistance().compareTo(o2.getDistance()); |
| | | } |
| | | }); |
| | | return worldCupListCoach1; |
| | |
| | | worldCupCompetitorService.save(worldCupCompetitor); |
| | | ids.add(worldCupCompetitor.getId()); |
| | | //已参赛 |
| | | // worldCupPaymentParticipant.setAlreadyEntered(1); |
| | | // worldCupPaymentParticipantService.updateById(worldCupPaymentParticipant); |
| | | if(0 == worldCupPaymentParticipant.getAlreadyEntered()){ |
| | | worldCupPaymentParticipant.setAlreadyEntered(1); |
| | | worldCupPaymentParticipantService.updateById(worldCupPaymentParticipant); |
| | | } |
| | | } |
| | | worldCup.setMatchNumber(worldCup.getMatchNumber() + 1); |
| | | this.updateById(worldCup); |
| | |
| | | */ |
| | | @Override |
| | | public List<WorldCupListVo> getWorldCupList(WorldCupList worldCupList) { |
| | | if(null != worldCupList.getGender() && 0 == worldCupList.getGender()){ |
| | | worldCupList.setGender(null); |
| | | } |
| | | List<WorldCupListVo> worldCupList1 = this.baseMapper.getWorldCupList(worldCupList); |
| | | for (WorldCupListVo worldCupListVo : worldCupList1) { |
| | | Integer id = Integer.valueOf(worldCupListVo.getId()); |
| | |
| | | worldCupListVo.setHeat(heat); |
| | | String lat = worldCupListVo.getLat(); |
| | | String lon = worldCupListVo.getLon(); |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(lon + "," + lat, worldCupList.getLon() + "," + worldCupList.getLat()); |
| | | worldCupListVo.setDistance(distance.get("WGS84")); |
| | | if(ToolUtil.isNotEmpty(lat) && ToolUtil.isNotEmpty(lon)){ |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(lon + "," + lat, worldCupList.getLon() + "," + worldCupList.getLat()); |
| | | worldCupListVo.setDistance(distance.get("WGS84")); |
| | | }else{ |
| | | worldCupListVo.setDistance(0D); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | objects.add(map); |
| | | } |
| | | worldCupInfo.setStoreInfos(objects); |
| | | String address = worldCupInfo.getAddress(); |
| | | String province = worldCupInfo.getProvince(); |
| | | String city = worldCupInfo.getCity(); |
| | | int index = address.indexOf("市"); |
| | | if(index != -1){ |
| | | address = address.substring(index + 1); |
| | | worldCupInfo.setAddress(address); |
| | | } |
| | | index = province.indexOf("省"); |
| | | if(index != -1){ |
| | | province = province.substring(0, index - 1); |
| | | worldCupInfo.setProvince(province); |
| | | } |
| | | index = city.indexOf("市"); |
| | | if(index != -1){ |
| | | city = city.substring(0, index - 1); |
| | | worldCupInfo.setCity(city); |
| | | } |
| | | |
| | | return worldCupInfo; |
| | | } |
| | | |
| | |
| | | int count = worldCupPaymentParticipantService.count(new QueryWrapper<WorldCupPaymentParticipant>().eq("worldCupId", worldCup.getId()) |
| | | .eq("worldCupPaymentId", ids)); |
| | | if((count + jsonArray.size()) >= worldCup.getMaxPeople()){ |
| | | return ResultUtil.error("已超出最大报名人数"); |
| | | } |
| | | }else{ |
| | | if(jsonArray.size() > worldCup.getMaxPeople()){ |
| | | return ResultUtil.error("已超出最大报名人数"); |
| | | } |
| | | } |
| | |
| | | BigDecimal multiply = new BigDecimal(num).multiply(new BigDecimal(worldCup.getClassHour())); |
| | | String ids = paymentWorldCup.getIds(); |
| | | JSONArray jsonArray = JSON.parseArray(ids); |
| | | List<DeductionClassHour> list = new ArrayList<>(); |
| | | |
| | | |
| | | List<CoursePackageOrderStudent> coursePackageOrderStudent = coursePackageOrderStudentClient.getCoursePackageOrderUser(paymentWorldCup.getUid()); |
| | | int sum = coursePackageOrderStudent.stream().mapToInt(CoursePackageOrderStudent::getLaveClassHours).sum(); |
| | | if(sum < worldCup.getClassHour()){ |
| | | return ResultUtil.error("报名失败,课时不足,请续课!"); |
| | | } |
| | | |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Long id = jsonObject.getLong("id"); |
| | | //是否是学员(0=否,1=是) |
| | | Integer isStudent = jsonObject.getInteger("isStudent"); |
| | | if(0 == isStudent){ |
| | | return ResultUtil.error("非学员无法使用课时报名"); |
| | | } |
| | | List<CoursePackageOrderStudent> coursePackageOrderStudent = coursePackageOrderStudentClient.getCoursePackageOrderStudent(id.intValue()); |
| | | int sum = coursePackageOrderStudent.stream().mapToInt(CoursePackageOrderStudent::getLaveClassHours).sum(); |
| | | if(sum < worldCup.getClassHour()){ |
| | | return ResultUtil.error("报名失败,课时不足,请续课!"); |
| | | } |
| | | } |
| | | |
| | | worldCupPayment.setAmount(multiply); |
| | | worldCupPayment.setPayStatus(2); |
| | | worldCupPayment.setPayTime(new Date()); |
| | | worldCupPayment.setUnitPrice(worldCupPayment.getAmount().divide(new BigDecimal(num))); |
| | | worldCupPaymentService.save(worldCupPayment); |
| | | |
| | | //添加报名明细 |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Long id = jsonObject.getLong("id"); |
| | | //是否是学员(0=否,1=是) |
| | | Integer isStudent = jsonObject.getInteger("isStudent"); |
| | | List<DeductionClassHour> list = new ArrayList<>(); |
| | | //构建扣减课时数据 |
| | | Integer classHour = worldCup.getClassHour(); |
| | | for (CoursePackageOrderStudent packageOrderStudent : coursePackageOrderStudent) { |
| | | Integer laveClassHours = packageOrderStudent.getLaveClassHours(); |
| | | if(laveClassHours == 0){ |
| | | continue; |
| | | } |
| | | |
| | | DeductionClassHour deductionClassHour = new DeductionClassHour(); |
| | | if(classHour.compareTo(laveClassHours) > 0){ |
| | |
| | | deductionClassHour.setClassHour(laveClassHours); |
| | | deductionClassHour.setStudentId(packageOrderStudent.getStudentId()); |
| | | deductionClassHour.setCoursePackageId(packageOrderStudent.getCoursePackageId()); |
| | | packageOrderStudent.setLaveClassHours(0); |
| | | list.add(deductionClassHour); |
| | | }else{ |
| | | //够扣除直接跳出进行下个学员 |
| | |
| | | deductionClassHour.setClassHour(classHour); |
| | | deductionClassHour.setStudentId(packageOrderStudent.getStudentId()); |
| | | deductionClassHour.setCoursePackageId(packageOrderStudent.getCoursePackageId()); |
| | | packageOrderStudent.setLaveClassHours(laveClassHours - classHour); |
| | | list.add(deductionClassHour); |
| | | break; |
| | | } |
| | |
| | | worldCupPaymentParticipant.setAlreadyEntered(0); |
| | | worldCupPaymentParticipant.setCreateTime(new Date()); |
| | | worldCupPaymentParticipant.setContent(JSON.toJSONString(deductionClassHourList1)); |
| | | worldCupPaymentParticipantService.save(worldCupPaymentParticipant); |
| | | } |
| | | |
| | | worldCupPayment.setAmount(multiply); |
| | | worldCupPayment.setPayStatus(2); |
| | | worldCupPayment.setPayTime(new Date()); |
| | | worldCupPayment.setUnitPrice(worldCupPayment.getAmount().divide(new BigDecimal(num))); |
| | | worldCupPaymentService.save(worldCupPayment); |
| | | |
| | | //添加报名明细 |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Long id = jsonObject.getLong("id"); |
| | | //是否是学员(0=否,1=是) |
| | | Integer isStudent = jsonObject.getInteger("isStudent"); |
| | | |
| | | WorldCupPaymentParticipant worldCupPaymentParticipant = new WorldCupPaymentParticipant(); |
| | | worldCupPaymentParticipant.setWorldCupId(paymentWorldCup.getId()); |
| | | worldCupPaymentParticipant.setWorldCupPaymentId(worldCupPayment.getId()); |
| | | worldCupPaymentParticipant.setAppUserId(paymentWorldCup.getUid()); |
| | | worldCupPaymentParticipant.setParticipantType(isStudent == 0 ? 2 : 1); |
| | | worldCupPaymentParticipant.setParticipantId(id); |
| | | worldCupPaymentParticipant.setAlreadyEntered(0); |
| | | worldCupPaymentParticipantService.save(worldCupPaymentParticipant); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public ResultUtil paymentWorldCupCallback(String code, String outTradeNo) { |
| | | WorldCupPayment worldCupPayment = worldCupPaymentService.getOne(new QueryWrapper<WorldCupPayment>().eq("code", code)); |
| | | Integer worldCupId = worldCupPayment.getWorldCupId(); |
| | | worldCupPayment.setPayStatus(2); |
| | | worldCupPayment.setPayOrderNo(outTradeNo); |
| | | worldCupPayment.setPayTime(new Date()); |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | |
| | | //添加报名明细 |
| | |
| | | Integer isStudent = jsonObject.getInteger("isStudent"); |
| | | |
| | | WorldCupPaymentParticipant worldCupPaymentParticipant = new WorldCupPaymentParticipant(); |
| | | worldCupPaymentParticipant.setWorldCupId(worldCupPayment.getWorldCupId()); |
| | | worldCupPaymentParticipant.setWorldCupId(worldCupId); |
| | | worldCupPaymentParticipant.setWorldCupPaymentId(worldCupPayment.getId()); |
| | | worldCupPaymentParticipant.setAppUserId(worldCupPayment.getAppUserId()); |
| | | worldCupPaymentParticipant.setParticipantType(isStudent == 0 ? 2 : 1); |
| | |
| | | */ |
| | | @Override |
| | | public void cancelWorldCupRefund(Integer id) { |
| | | List<WorldCupPaymentParticipant> list = worldCupPaymentParticipantService.list(new QueryWrapper<WorldCupPaymentParticipant>() |
| | | .eq("worldCupId", id).eq("alreadyEntered", 0)); |
| | | Set<Long> collect = list.stream().map(WorldCupPaymentParticipant::getWorldCupPaymentId).collect(Collectors.toSet()); |
| | | for (Long worldCupPaymentId : collect) { |
| | | //免费除外 |
| | | List<WorldCupPayment> list2 = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", id) |
| | | .ne("payType", 0).eq("payStatus", 2).eq("state", 1)); |
| | | for (WorldCupPayment worldCupPayment : list2) { |
| | | List<WorldCupPaymentParticipant> list1 = worldCupPaymentParticipantService.list(new QueryWrapper<WorldCupPaymentParticipant>() |
| | | .eq("worldCupPaymentId", worldCupPaymentId).eq("alreadyEntered", 0)); |
| | | WorldCupPayment worldCupPayment = worldCupPaymentService.getById(worldCupPaymentId); |
| | | .eq("worldCupId", id).eq("worldCupPaymentId", worldCupPayment.getId()).eq("alreadyEntered", 0)); |
| | | //总支付金额 |
| | | 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); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | } |
| | | //微信支付 |
| | | if(worldCupPayment.getPayType() == 1){ |
| | | Map<String, String> map = payMoneyUtil.wxRefund(worldCupPayment.getPayOrderNo(), worldCupPayment.getCode(), |
| | |
| | | if(!"SUCCESS".equals(map.get("return_code"))){ |
| | | System.err.println("-------------微信退款失败---------"); |
| | | System.err.println(map.get("return_msg")); |
| | | }else{ |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | } |
| | | } |
| | | //支付宝支付 |
| | |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(trade_no); |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | } |
| | |
| | | worldCupPayment.setWorldCupId(null); |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | } |
| | | //课时支付 |
| | | if(worldCupPayment.getPayType() == 4){ |
| | | for (WorldCupPaymentParticipant worldCupPaymentParticipant : list1) { |
| | | String content = worldCupPaymentParticipant.getContent(); |
| | | for (WorldCupPaymentParticipant worldCupPaymentParticipant1 : list1) { |
| | | String content = worldCupPaymentParticipant1.getContent(); |
| | | DeductionClassHourList deductionClassHourList = JSON.parseObject(content, DeductionClassHourList.class); |
| | | coursePackageOrderStudentClient.backspaceClassHour(deductionClassHourList); |
| | | } |
| | |
| | | worldCupPayment.setRefundTime(new Date()); |
| | | worldCupPayment.setRefundOrderNo(""); |
| | | worldCupPayment.setPayStatus(3); |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | worldCupPaymentService.updateById(worldCupPayment); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | private String appid = "";//微信appid |
| | | private String appid = "wx41d32f362ba0f911";//微信appid |
| | | |
| | | private String appletsAppid = "";//微信小程序appid |
| | | private String appSecret = "cf0ebf950f5926a69041a0e2bbe20f3e"; |
| | | |
| | | private String mchId = "";//微信商户号 |
| | | private String mchId = "1501481761";//微信商户号 |
| | | |
| | | private String key = "";//微信商户号 |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "http://8.137.22.229:56666/competition";//支付回调网关地址 |
| | | private String callbackPath = "http://221.182.45.100:56666/communityWorldCup";//支付回调网关地址 |
| | | |
| | | private String app_cert_path = "C:/cert/alipay/user/app_cert_path.crt";//应用公钥证书路径 |
| | | |
| | |
| | | |
| | | private String alipay_root_cert_path = "C:/cert/alipay/user/alipay_root_cert_path.crt";//支付宝CA根证书文件路径 |
| | | |
| | | private String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//微信证书 |
| | | private String certPath = "C:\\Users\\Admin\\Desktop\\weixin_cert\\apiclient_cert.p12";//微信证书 |
| | | |
| | | // private String certPath = "/usr/playpai/cert/weixin/apiclient_cert.p12";//微信证书 |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | String nonce_str = UUIDUtil.getRandomCode(16); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appid", "APP".equals(tradeType) ? appid : appletsAppid); |
| | | map.put("appid", appid); |
| | | map.put("mch_id", mchId); |
| | | map.put("nonce_str", nonce_str); |
| | | map.put("body", body); |
| | |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | map1.put("refund_id", map.get("refund_id")); |
| | | map1.put("out_refund_no", map.get("out_refund_no")); |
| | | map1.put("out_refund_no", map.get("out_refund_no")); |
| | | String result = "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>"; |
| | | map1.put("result", result); |
| | | return map1; |
| | |
| | | |
| | | |
| | | <select id="worldCupRecordsList" resultType="map"> |
| | | select @row_num := @row_num + 1 AS row_num, bb.* from ( |
| | | select * from ( |
| | | select @row_num := @row_num + 1 AS row_num, |
| | | bb.participantType, |
| | | bb.participantId, |
| | | bb.appUserId, |
| | | bb.totalSession, |
| | | bb.win, |
| | | ROUND(bb.winRate, 2) as winRate |
| | | from ( |
| | | select |
| | | aa.participantType, |
| | | aa.participantId, |
| | | aa.appUserId, |
| | | aa.totalSession, |
| | | aa.win, |
| | | aa.winRate |
| | | from ( |
| | | select |
| | | a.participantType, |
| | | a.participantId, |
| | |
| | | lon, |
| | | lat, |
| | | CASE status WHEN 1 THEN 2 WHEN 2 THEN 1 ELSE status END as sort |
| | | from t_world_cup where 1 = 1 |
| | | from t_world_cup where status != 3 |
| | | <if test="null != item.content and '' != item.content"> |
| | | and `name` like CONCAT('%', #{item.content}, '%') |
| | | </if> |
| | |
| | | select |
| | | a.id, |
| | | a.name, |
| | | DATE_FORMAT(a.registrationClosingTime, '%Y-%m-%d %H:%i') as registrationClosingTime, |
| | | DATE_FORMAT(ifnull(a.registrationClosingTime, a.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime, |
| | | CONCAT(a.startAge, '-', a.endAge) as age, |
| | | a.coverImg, |
| | | a.intro as content, |
| | |
| | | a.basePeople as heat, |
| | | DATE_FORMAT(a.startTime, '%Y-%m-%d %H:%i') as startTime, |
| | | DATE_FORMAT(a.endTime, '%Y-%m-%d %H:%i') as endTime, |
| | | DATE_FORMAT(a.registrationClosingTime, '%Y-%m-%d %H:%i') as registrationClosingTime, |
| | | DATE_FORMAT(ifnull(a.registrationClosingTime, a.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime, |
| | | CONCAT(a.startAge, '-', a.endAge) as age, |
| | | a.gender, |
| | | a.province, |
| | |
| | | <select id="getWorldCupPaymentParticipant" resultType="com.dsh.communityWorldCup.entity.WorldCupPaymentParticipant"> |
| | | select * |
| | | from t_world_cup_payment_participant |
| | | where alreadyEntered = 0 and worldCupId = #{worldCupId} and participantType = #{participantType} and participantId = #{participantId} and worldCupPaymentId in ( |
| | | where worldCupId = #{worldCupId} and participantType = #{participantType} and participantId = #{participantId} and worldCupPaymentId in ( |
| | | select id from t_world_cup_payment where worldCupId = #{worldCupId} and payStatus = 2 and state = 1 |
| | | ) order by createTime desc limit 0, 1 |
| | | </select> |
| | |
| | | a.id, |
| | | b.worldCupId, |
| | | c.name, |
| | | DATE_FORMAT(c.registrationClosingTime, '%Y-%m-%d %H:%i') as registrationClosingTime, |
| | | DATE_FORMAT(ifnull(c.registrationClosingTime, c.endTime), '%Y-%m-%d %H:%i') as registrationClosingTime, |
| | | CONCAT(c.startAge, '-', c.endAge) as age, |
| | | c.coverImg, |
| | | c.intro as content, |
| | |
| | | TStudent student1 = studentClient.queryById(editParticipant.getId()); |
| | | student.setName(student1.getName()); |
| | | student.setIdCard(editParticipant.getIdcard()); |
| | | student.setHeadImg(editParticipant.getHeadImg()); |
| | | if (editParticipant.getHeight() != null) { |
| | | student.setHeight(Double.valueOf(editParticipant.getHeight())); |
| | | } |
| | | |
| | | if (editParticipant.getWeight() != null) { |
| | | student.setWeight(editParticipant.getWeight()); |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(student.getName()) && ToolUtil.isNotEmpty(student.getIdCard())) { |
| | | Boolean aBoolean = JuHeUtil.idcardAuthentication(student.getIdCard(), student.getName()); |
| | | if (!aBoolean) { |
| | |
| | | private String phone; |
| | | @ApiModelProperty(value = "姓名", dataType = "string", required = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "头像", dataType = "string", required = true) |
| | | private String headImg; |
| | | @ApiModelProperty(value = "生日", dataType = "string", required = false) |
| | | private String birthday; |
| | | @ApiModelProperty(value = "性别(1=男,2=女)", dataType = "int", required = false) |
| | |
| | | package com.dsh.competition.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Integer id; |
| | | @ApiModelProperty("姓名") |
| | | private String name; |
| | | @ApiModelProperty("姓名") |
| | | private String headImg; |
| | | @ApiModelProperty("年龄") |
| | | private Integer age; |
| | | @ApiModelProperty("身份证号码") |
| | |
| | | participantVo.setIdcard(participant.getIdcard()); |
| | | Integer age = Integer.valueOf(sdf_year.format(new Date())) - Integer.valueOf(sdf_year.format(participant.getBirthday())); |
| | | participantVo.setAge(age); |
| | | Student student = studentClient.queryStudentByPhone(participant.getPhone() == null ? "0" : participant.getPhone()); |
| | | |
| | | Student student = null; |
| | | if(ToolUtil.isNotEmpty(participant.getPhone())){ |
| | | student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | } |
| | | //设为不是学员 |
| | | participantVo.setIsStudent(0); |
| | | |
| | | if (null != student) { |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHour(student.getId()); |
| | | participantVo.setResidueClassHour(integer); |
| | | |
| | | } else { |
| | | participantVo.setResidueClassHour(0); |
| | | } |
| | | participantVo.setPhone(participant.getPhone()); |
| | | participantVo.setHeight(participant.getHeight()); |
| | | participantVo.setWeight(participant.getWeight()); |
| | | participantVo.setHeadImg(participant.getHeadImg()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if (null != participant.getBirthday()) { |
| | | String format = sdf.format(participant.getBirthday()); |
| | | participantVo.setBirthday(format); |
| | | } |
| | | participantVo.setGender(participant.getGender()); |
| | | if (participant.getIdcard() == null || participant.getIdcard().isEmpty()) { |
| | | listVo1.add(participantVo); |
| | | continue; |
| | | } |
| | | linkedHashMap.put(participant.getIdcard(), participantVo); |
| | | |
| | | // if (participant.getIdcard() == null || participant.getIdcard().isEmpty()) { |
| | | // listVo1.add(participantVo); |
| | | // continue; |
| | | // } |
| | | linkedHashMap.put(participant.getName(), participantVo); |
| | | } |
| | | |
| | | for (TStudent tStudent : tStudents) { |
| | |
| | | participantVo.setPhone(tStudent.getPhone()); |
| | | participantVo.setHeight(tStudent.getHeight().intValue()); |
| | | participantVo.setWeight(tStudent.getWeight()); |
| | | participantVo.setHeadImg(tStudent.getHeadImg()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if (null != tStudent.getBirthday()) { |
| | | String format = sdf.format(tStudent.getBirthday()); |
| | |
| | | } |
| | | participantVo.setGender(tStudent.getSex()); |
| | | participantVo.setIsStudent(1); |
| | | if (tStudent.getIdCard() == null || tStudent.getIdCard().isEmpty()) { |
| | | listVo1.add(participantVo); |
| | | continue; |
| | | } |
| | | linkedHashMap.put(tStudent.getIdCard(), participantVo); |
| | | // if (tStudent.getIdCard() == null || tStudent.getIdCard().isEmpty()) { |
| | | // listVo1.add(participantVo); |
| | | // continue; |
| | | // } |
| | | linkedHashMap.put(tStudent.getName(), participantVo); |
| | | } |
| | | |
| | | |
| | | listVo1.addAll(linkedHashMap.values()); |
| | | |
| | | |
| | | // List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values()); |
| | | |
| | | |
| | | return listVo1; |
| | | } |
| | | |
| | |
| | | participant.setGender(editParticipant.getGender()); |
| | | participant.setIdcard(editParticipant.getIdcard()); |
| | | participant.setName(editParticipant.getName()); |
| | | participant.setHeadImg(editParticipant.getHeadImg()); |
| | | if (ToolUtil.isNotEmpty(editParticipant.getBirthday())) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | participant.setBirthday(sdf.parse(editParticipant.getBirthday())); |
| | |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | private String appid = "";//微信appid |
| | | private String appid = "wx41d32f362ba0f911";//微信appid |
| | | |
| | | private String appletsAppid = "";//微信小程序appid |
| | | private String appSecret = "cf0ebf950f5926a69041a0e2bbe20f3e"; |
| | | |
| | | private String mchId = "";//微信商户号 |
| | | private String mchId = "1501481761";//微信商户号 |
| | | |
| | | private String key = "";//微信商户号 |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "http://8.137.22.229:56666/competition";//支付回调网关地址 |
| | | |
| | |
| | | } |
| | | String nonce_str = UUIDUtil.getRandomCode(16); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appid", "APP".equals(tradeType) ? appid : appletsAppid); |
| | | map.put("appid", appid); |
| | | map.put("mch_id", mchId); |
| | | map.put("nonce_str", nonce_str); |
| | | map.put("body", body); |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CoursePackageOrder; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.course.model.DeductionClassHourList; |
| | | import com.dsh.course.service.ICoursePackageOrderService; |
| | | import com.dsh.course.service.ICoursePackageOrderStudentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService coursePackageOrderStudentService; |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderService coursePackageOrderService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据学院id获取剩余有效课时数据 |
| | | * 根据学员id获取剩余有效课时数据 |
| | | * @param studentId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据用户id获取剩余有效课时数据 |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getCoursePackageOrderUser") |
| | | public List<CoursePackageOrderStudent> getCoursePackageOrderUser(@RequestBody Integer appUserId){ |
| | | return coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .eq("appUserId", appUserId).eq("status", 1).eq("state", 1) |
| | | .gt("laveClassHours", 0).last(" and useTime > now() order by insertTime")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 扣减学员课时 |
| | | * @param deductionClassHourList |
| | |
| | | //未上的排课数据 |
| | | List<CoursePackageScheduling> packageSchedulings = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>().eq("studentId", coursePackageOrderStudent.getStudentId()) |
| | | .eq("type", 1).eq("coursePackageId", coursePackageOrderStudent.getCoursePackageId()).eq("status", 1).orderByDesc("classDate")); |
| | | //排课使用的总课时 |
| | | //已经排课的总课时 |
| | | int classHour = packageSchedulings.size() * codeTime; |
| | | //未排课的课时 |
| | | int notClass = laveClassHours - classHour; |
| | | |
| | | /** |
| | | * 1、查询剩余已经排课的数据 |
| | | * 2、判断 剩余课时- 未上排课 = 可扣减 -->是否满足扣减 |
| | | * --->满足扣减,直接减去剩余课时 |
| | | * --->不满足扣减,需要计算出删除的排课节数(注意每节消耗的课时数),然后减去剩余课时 |
| | | */ |
| | | |
| | | //判断是否需要删除排课数据 |
| | | if(notClass < deductionClassHour.getClassHour()){ |
| | | //计算需要删除的排课数量 |
| | | int clss = deductionClassHour.getClassHour() - notClass; |
| | | int n = clss % codeTime; |
| | | int l = 0; |
| | | int num = clss / codeTime; |
| | | //不整除的情况,需要多删除一节排课,回加差额课时。 |
| | | if(n != 0){ |
| | | n += 1; |
| | | l = (codeTime * n) - clss; |
| | | num += 1; |
| | | } |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackageOrderStudent.getLaveClassHours() + l); |
| | | |
| | | //删除已排的课程 |
| | | List<CoursePackageScheduling> coursePackageSchedulings = packageSchedulings.subList(0, n); |
| | | List<CoursePackageScheduling> coursePackageSchedulings = packageSchedulings.subList(0, num); |
| | | List<Long> collect = coursePackageSchedulings.stream().map(CoursePackageScheduling::getId).collect(Collectors.toList()); |
| | | coursePackageSchedulingService.removeByIds(collect); |
| | | coursePackageStudentMapper.delete(new QueryWrapper<CoursePackageStudent>().in("coursePackageSchedulingId", collect)); |
| | | |
| | | deductionClassHour.setScheduledCourses(n); |
| | | if(collect.size() > 0){ |
| | | coursePackageSchedulingService.removeByIds(collect); |
| | | coursePackageStudentMapper.delete(new QueryWrapper<CoursePackageStudent>().in("coursePackageSchedulingId", collect)); |
| | | } |
| | | deductionClassHour.setScheduledCourses(num); |
| | | }else{ |
| | | deductionClassHour.setScheduledCourses(0); |
| | | } |
| | | |
| | | this.updateById(coursePackageOrderStudent); |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackageOrderStudent.getId()); |
| | | courseCounsum.setChangeType(0); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(deductionClassHour.getClassHour()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("社区世界杯报名"); |
| | | courseCounsum.setReason("取消社区世界杯报名"); |
| | | courseCounsum.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | //需要排课的节数 |
| | | Integer scheduledCourses = deductionClassHour.getScheduledCourses(); |
| | | TCoursePackage coursePackage = coursePackageService.getById(coursePackageOrderStudent.getCoursePackageId()); |
| | | Integer codeTime = coursePackage.getCodeTime(); |
| | | CoursePackageScheduling one = coursePackageSchedulingService.getOne(new QueryWrapper<CoursePackageScheduling>().eq("studentId", coursePackageOrderStudent.getStudentId()) |
| | | .eq("type", 1).eq("coursePackageId", coursePackageOrderStudent.getCoursePackageId()).eq("status", 1) |
| | | .orderByDesc("classDate").last(" limit 0, 1")); |
| | | if(scheduledCourses > 0){ |
| | | TCoursePackage coursePackage = coursePackageService.getById(coursePackageOrderStudent.getCoursePackageId()); |
| | | Integer codeTime = coursePackage.getCodeTime(); |
| | | CoursePackageScheduling one = coursePackageSchedulingService.getOne(new QueryWrapper<CoursePackageScheduling>().eq("studentId", coursePackageOrderStudent.getStudentId()) |
| | | .eq("type", 1).eq("coursePackageId", coursePackageOrderStudent.getCoursePackageId()).eq("status", 1) |
| | | .orderByDesc("classDate").last(" limit 0, 1")); |
| | | |
| | | //上课星期 |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | //新排课的开始日期 |
| | | Calendar start = Calendar.getInstance(); |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | String[] split = classStartTime.split(","); |
| | | String[] split1 = classEndTime.split(","); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | //计算剩余课时最大排课节数 |
| | | int num = laveClassHours / codeTime; |
| | | //比较除哪个最小以哪个来确定排课节数 |
| | | num = num > scheduledCourses ? scheduledCourses : num; |
| | | //上课星期 |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | //新排课的开始日期 |
| | | Calendar start = Calendar.getInstance(); |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | String[] split = classStartTime.split(","); |
| | | String[] split1 = classEndTime.split(","); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | //计算剩余课时最大排课节数 |
| | | int num = laveClassHours / codeTime; |
| | | //比较除哪个最小以哪个来确定排课节数 |
| | | num = num > scheduledCourses ? scheduledCourses : num; |
| | | |
| | | //先检查当前是都还有需要排课的 |
| | | if(null != one){ |
| | | Date classDate = one.getClassDate(); |
| | | //先检查当前是都还有需要排课的 |
| | | if(null != one){ |
| | | Date classDate = one.getClassDate(); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(classDate); |
| | | String s = sdf.format(calendar.getTime()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(classDate); |
| | | String s = sdf.format(calendar.getTime()); |
| | | |
| | | for (int j = 0; j < split.length; j++) { |
| | | Date parse = null; |
| | | Date parse1 = null; |
| | | try { |
| | | parse = format.parse(s + " " + split[j]); |
| | | parse1 = format.parse(s + " " + split1[j]); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if(classDate.getTime() <= parse.getTime()){ |
| | | continue; |
| | | } |
| | | for (int j = 0; j < split.length; j++) { |
| | | Date parse = null; |
| | | Date parse1 = null; |
| | | try { |
| | | parse = format.parse(s + " " + split[j]); |
| | | parse1 = format.parse(s + " " + split1[j]); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if(classDate.getTime() >= parse.getTime()){ |
| | | continue; |
| | | } |
| | | |
| | | //开始组装排课数据 |
| | | CoursePackageScheduling packageScheduling = new CoursePackageScheduling(); |
| | | packageScheduling.setType(1); |
| | | packageScheduling.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | packageScheduling.setStudentId(coursePackageOrderStudent.getStudentId()); |
| | | packageScheduling.setCoursePackageId(coursePackage.getId()); |
| | | packageScheduling.setClassDate(parse); |
| | | packageScheduling.setEndDate(parse1); |
| | | packageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(packageScheduling); |
| | | |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | student1.setStudentId(coursePackageOrderStudent.getStudentId()); |
| | | student1.setCoursePackageId(coursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | student1.setCoursePackageSchedulingId(packageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | student1.setType(1); |
| | | coursePackageStudentMapper.insert(student1); |
| | | |
| | | num--; |
| | | if(num == 0){ |
| | | return; |
| | | } |
| | | } |
| | | |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | start = calendar; |
| | | } |
| | | |
| | | if(num == 0){ |
| | | return; |
| | | } |
| | | |
| | | //继续排后面的数据 |
| | | while (true) { |
| | | String s = sdf.format(start.getTime()); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = start.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | start.set(Calendar.DAY_OF_YEAR, start.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | for (int j = 0; j < split.length; j++) { |
| | | //开始组装排课数据 |
| | | CoursePackageScheduling packageScheduling = new CoursePackageScheduling(); |
| | | packageScheduling.setType(1); |
| | | packageScheduling.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | packageScheduling.setStudentId(coursePackageOrderStudent.getStudentId()); |
| | | packageScheduling.setCoursePackageId(coursePackage.getId()); |
| | | try { |
| | | Date parse = format.parse(s + " " + split[j]); |
| | | Date parse1 = format.parse(s + " " + split1[j]); |
| | | //开始组装排课数据 |
| | | CoursePackageScheduling packageScheduling = new CoursePackageScheduling(); |
| | | packageScheduling.setType(1); |
| | | packageScheduling.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | packageScheduling.setStudentId(coursePackageOrderStudent.getStudentId()); |
| | | packageScheduling.setCoursePackageId(coursePackage.getId()); |
| | | packageScheduling.setClassDate(parse); |
| | | packageScheduling.setEndDate(parse1); |
| | | packageScheduling.setStatus(1); |
| | |
| | | student1.setInsertTime(new Date()); |
| | | student1.setType(1); |
| | | coursePackageStudentMapper.insert(student1); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | |
| | | num--; |
| | | if(num <= 0){ |
| | | return; |
| | | } |
| | | } |
| | | num--; |
| | | if(num == 0){ |
| | | return; |
| | | } |
| | | |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | start = calendar; |
| | | } |
| | | start.set(Calendar.DAY_OF_YEAR, start.get(Calendar.DAY_OF_YEAR) + 1); |
| | | |
| | | if(num <= 0){ |
| | | return; |
| | | } |
| | | |
| | | //继续排后面的数据 |
| | | while (true) { |
| | | String s = sdf.format(start.getTime()); |
| | | |
| | | //判断当天是否在排课星期内 |
| | | int day = start.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | start.set(Calendar.DAY_OF_YEAR, start.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | |
| | | for (int j = 0; j < split.length; j++) { |
| | | //开始组装排课数据 |
| | | CoursePackageScheduling packageScheduling = new CoursePackageScheduling(); |
| | | packageScheduling.setType(1); |
| | | packageScheduling.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | packageScheduling.setStudentId(coursePackageOrderStudent.getStudentId()); |
| | | packageScheduling.setCoursePackageId(coursePackage.getId()); |
| | | try { |
| | | Date parse = format.parse(s + " " + split[j]); |
| | | Date parse1 = format.parse(s + " " + split1[j]); |
| | | packageScheduling.setClassDate(parse); |
| | | packageScheduling.setEndDate(parse1); |
| | | packageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(packageScheduling); |
| | | |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(coursePackageOrderStudent.getAppUserId()); |
| | | student1.setStudentId(coursePackageOrderStudent.getStudentId()); |
| | | student1.setCoursePackageId(coursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | student1.setCoursePackageSchedulingId(packageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | student1.setType(1); |
| | | coursePackageStudentMapper.insert(student1); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | num--; |
| | | if(num <= 0){ |
| | | return; |
| | | } |
| | | } |
| | | start.set(Calendar.DAY_OF_YEAR, start.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | coursePackageOrderStudentService.saveOrUpdate(coursePackageOrderStudent); |
| | | |
| | | //更新学员课时有效期 |
| | | boolean b = true; |
| | | if(null == student.getValidity()){ |
| | | student.setValidity(calendar.getTime()); |
| | | addOldPackageStudent(student); |
| | | b = false; |
| | | }else if(calendar.getTimeInMillis() > student.getValidity().getTime()){ |
| | | student.setValidity(calendar.getTime()); |
| | | addOldPackageStudent(student); |
| | | b = false; |
| | | } |
| | | studentClient.frozen(student); |
| | | |
| | | //开始排课 |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent, student.getValidity()); |
| | | if(b){ |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent, student.getValidity()); |
| | | } |
| | | |
| | | //课时记录 |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | |
| | | coursePackageOrderStudent.setUseTime(calendar.getTime()); |
| | | coursePackageOrderStudentService.saveOrUpdate(coursePackageOrderStudent); |
| | | //更新学员课时有效期 |
| | | boolean b = true; |
| | | if(null == student.getValidity()){ |
| | | student.setValidity(calendar.getTime()); |
| | | addOldPackageStudent(student); |
| | | b = false; |
| | | }else if(calendar.getTimeInMillis() > student.getValidity().getTime()){ |
| | | student.setValidity(calendar.getTime()); |
| | | addOldPackageStudent(student); |
| | | b = false; |
| | | } |
| | | studentClient.frozen(student); |
| | | |
| | | //中间断课,没有连续续费的情况需要重新排课 |
| | | if (useTime.compareTo(new Date()) < 0) { |
| | | if (useTime.compareTo(new Date()) < 0 && b) { |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent, student.getValidity()); |
| | | } |
| | | |
| | |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | private String appid = "wx82f853a410b0c7c0";//微信appid |
| | | |
| | | private String appletsAppid = "";//微信小程序appid |
| | | private String smid = "2088330203191220";//平台支付宝商户号 |
| | | |
| | | private String appid = "wx41d32f362ba0f911";//微信appid |
| | | |
| | | private String appSecret = "cf0ebf950f5926a69041a0e2bbe20f3e"; |
| | | |
| | | private String mchId = "1501481761";//微信商户号 |
| | | |
| | |
| | | } |
| | | String nonce_str = UUIDUtil.getRandomCode(16); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appid", "APP".equals(tradeType) ? appid : appletsAppid); |
| | | map.put("appid", appid); |
| | | map.put("mch_id", mchId); |
| | | map.put("nonce_str", nonce_str); |
| | | map.put("body", body); |
| | |
| | | * 删除世界杯门店关系数据 |
| | | * @param worldCupId |
| | | */ |
| | | @PostMapping("/worldCup/addWorldCupStore") |
| | | @PostMapping("/worldCup/delWorldCupStore") |
| | | void delWorldCupStore(@RequestBody Integer worldCupId); |
| | | |
| | | |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数) |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | <div id="table4"></div> |
| | | </div> |
| | | <div class="table-container"> |
| | | <h3 class = "title">赢家:</h3> |
| | | <h3 class = "title">常胜将军:</h3> |
| | | <div id="table5"></div> |
| | | </div> |
| | | <div class="table-container"> |
| | | <h3 class = "title">次数:</h3> |
| | | <h3 class = "title">越战越勇:</h3> |
| | | <div id="table6"></div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/worldCup/worldCup_info.js"></script> |
| | | <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> |
| | | <script src="${ctxPath}/modular/system/worldCup/worldCup_info.js"></script> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | |
| | | for (let i = 0; i < input5.length-1; i++) { |
| | | data1.type5.condition.push(input5[i].value); |
| | | if (Number(input5[i].value)>Number(input5[i+1].value)){ |
| | | return Feng.error("赢家等级满足条件值设置错误!错误在等级"+(i+1)+"和等级"+(i+1+1)); |
| | | return Feng.error("常胜将军等级满足条件值设置错误!错误在等级"+(i+1)+"和等级"+(i+1+1)); |
| | | } |
| | | if (i === input5.length-1-1){ |
| | | data1.type5.condition.push(input5[i+1].value); |
| | |
| | | for (let i = 0; i < input6.length-1; i++) { |
| | | data1.type6.condition.push(input6[i].value); |
| | | if (Number(input6[i].value)>Number(input6[i+1].value)){ |
| | | return Feng.error("次数等级满足条件值设置错误!错误在等级"+(i+1)+"和等级"+(i+1+1)); |
| | | return Feng.error("越战越勇等级满足条件值设置错误!错误在等级"+(i+1)+"和等级"+(i+1+1)); |
| | | } |
| | | if (i === input6.length-1-1){ |
| | | data1.type6.condition.push(input6[i+1].value); |
| | |
| | | }; |
| | | |
| | | |
| | | WorldCup.cancelWorldCup = function(){ |
| | | if(this.check()){ |
| | | var operation = function(){ |
| | | layer.load(); |
| | | var id = WorldCup.seItem.id; |
| | | var ajax = new $ax(Feng.ctxPath + "/worldCup/updateState", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("取消成功"); |
| | | WorldCup.search(); |
| | | layer.closeAll(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("取消失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.set("state", 3); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("是否取消赛事: " + WorldCup.seItem.name + "?",operation); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | $(function () { |
| | | var defaultColunms1 = [ |
| | | {field: 'selectItem', checkbox: true}, |
| | | {field: 'selectItem', visible: false, checkbox: false}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '名次', field: 'row_num', visible: true, align: 'center', valign: 'middle',width:'20%',}, |
| | | {title: '用户姓名', field: 'name', visible: true, align: 'center', valign: 'middle',}, |
| | |
| | | stuMedalVo.setMedalName("深度玩家"); |
| | | break; |
| | | case 5: |
| | | stuMedalVo.setMedalName("赢家"); |
| | | stuMedalVo.setMedalName("常胜将军"); |
| | | break; |
| | | case 6: |
| | | stuMedalVo.setMedalName("次数"); |
| | | stuMedalVo.setMedalName("越战越勇"); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数) |
| | | * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | @Data |
| | | public class StuMedalVo { |
| | | |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)") |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇)") |
| | | private Integer medalType; |
| | | |
| | | @ApiModelProperty(value = "勋章名称 例如:俱乐部之星") |
| | |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | private String appid = "";//微信appid |
| | | private String appid = "wx41d32f362ba0f911";//微信appid |
| | | |
| | | private String appletsAppid = "";//微信小程序appid |
| | | private String appSecret = "cf0ebf950f5926a69041a0e2bbe20f3e"; |
| | | |
| | | private String mchId = "";//微信商户号 |
| | | private String mchId = "1501481761";//微信商户号 |
| | | |
| | | private String key = "";//微信商户号 |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "http://8.137.22.229:56666/other";//支付回调网关地址 |
| | | |
| | |
| | | } |
| | | String nonce_str = UUIDUtil.getRandomCode(16); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appid", "APP".equals(tradeType) ? appid : appletsAppid); |
| | | map.put("appid", appid); |
| | | map.put("mch_id", mchId); |
| | | map.put("nonce_str", nonce_str); |
| | | map.put("body", body); |