| | |
| | | if (null == appUserId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(honorService.queryStuOfMedalData(stuId)); |
| | | return ResultUtil.success(honorService.queryStuOfMedalData(stuId, appUserId)); |
| | | } catch (Exception e) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | */ |
| | | public interface StudentHonorService extends IService<StudentHonor> { |
| | | |
| | | List<GongVo> queryStuOfMedalData(Integer stuId); |
| | | List<GongVo> queryStuOfMedalData(Integer stuId, Integer appUserId); |
| | | |
| | | List<StuMedalVo> queryHonorDetails(Integer appUserId); |
| | | |
| | |
| | | RechargesDetail consumeDetail = new RechargesDetail(); |
| | | if(cupPayment.getPayStatus() != 3){ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getPayTime())); |
| | | consumeDetail.setConsumeAmount("-" + cupPayment.getAmount()); |
| | | consumeDetail.setRecordId(2); |
| | | details.add(consumeDetail); |
| | | }else{ |
| | | consumeDetail = new RechargesDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getPayTime())); |
| | | consumeDetail.setConsumeAmount("-" + cupPayment.getAmount()); |
| | | consumeDetail.setRecordId(2); |
| | | details.add(consumeDetail); |
| | | |
| | | consumeDetail = new RechargesDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getRefundTime())); |
| | | consumeDetail.setConsumeAmount("+" + cupPayment.getRefundAmount()); |
| | | consumeDetail.setRecordId(1); |
| | | details.add(consumeDetail); |
| | | } |
| | | details.add(consumeDetail); |
| | | } |
| | | |
| | | |
| | |
| | | private ResultUtil AlipayPayment(String code, BigDecimal amount) { |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid,"玩湃币充值", "玩湃币充值", "", code, amount.toString(), |
| | | "/base/recharge/alipayRechargeCallback"); |
| | | if (alipay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10) { |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | |
| | | RechargeRecords records = rereMapper.selectOne(new QueryWrapper<RechargeRecords>() |
| | | .eq("code", code)); |
| | | if (records.getPayStatus() == 2) { |
| | | break; |
| | | } |
| | | AlipayTradeQueryResponse resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | |
| | | if (resultUtil.getCode().equals("10000") && records.getPayStatus() == 1) { |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | | * TRADE_SUCCESS(交易支付成功)、 |
| | | * TRADE_FINISHED(交易结束,不可退款) |
| | | */ |
| | | // Map<String, String> data1 = resultUtil.getData(); |
| | | // String s = data1.get("tradeStatus"); |
| | | // String tradeNo = data1.get("tradeNo"); |
| | | |
| | | String tradeNo = resultUtil.getTradeNo(); |
| | | String tradeStatus = resultUtil.getTradeStatus(); |
| | | System.out.println("ssssss" + tradeStatus); |
| | | if ("TRADE_CLOSED".equals(tradeStatus) || "TRADE_FINISHED".equals(tradeStatus) || num == 10) { |
| | | records.setState(3); |
| | | rereMapper.deleteById(records.getId()); |
| | | if ("TRADE_FINISHED".equals(tradeStatus)) { |
| | | // todo 资金结算 |
| | | payMoneyUtil.confirm(smid,code,tradeNo,amount.toString()); |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if ("TRADE_SUCCESS".equals(tradeStatus)) { |
| | | records.setAppUserId(null); |
| | | records.setPayStatus(2); |
| | | records.setPayTime(new Date()); |
| | | records.setOrderNumber(tradeNo); |
| | | rereMapper.updateById(records); |
| | | |
| | | RechargeRecords rechargeRecords = rereMapper.selectOne(new QueryWrapper<RechargeRecords>() |
| | | .eq("code", code)); |
| | | if (rechargeRecords.getPayStatus() == 2) { |
| | | TAppUser tAppUser = tappMapper.selectById(rechargeRecords.getAppUserId()); |
| | | tAppUser.setPlayPaiCoins(null == tAppUser.getPlayPaiCoins() ? rechargeRecords.getPlayPaiCoins() : tAppUser.getPlayPaiCoins() + rechargeRecords.getPlayPaiCoins()); |
| | | tappMapper.updateById(tAppUser); |
| | | break; |
| | | } |
| | | |
| | | |
| | | break; |
| | | } |
| | | if ("WAIT_BUYER_PAY".equals(tradeStatus)) { |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return alipay; |
| | | } |
| | | |
| | | private ResultUtil WeChatPayment(String code, BigDecimal amount) throws Exception { |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("玩湃币充值", "", code, amount.toString(), |
| | | "/base/recharge/wechatRechargeCallback", "APP", ""); |
| | | if (weixinpay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10) { |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | RechargeRecords records = rereMapper.selectOne(new QueryWrapper<RechargeRecords>() |
| | | .eq("code", code)); |
| | | if (records.getPayStatus() == 2) { |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(code, ""); |
| | | if (resultUtil.getCode() == 200 && records.getPayStatus() == 1) { |
| | | /** |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | | * NOTPAY—未支付, |
| | | * CLOSED—已关闭, |
| | | * REVOKED—已撤销(刷卡支付), |
| | | * USERPAYING--用户支付中, |
| | | * PAYERROR--支付失败(其他原因,如银行返回失败) |
| | | */ |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("trade_state"); |
| | | String transaction_id = data1.get("transaction_id"); |
| | | if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) { |
| | | records.setState(3); |
| | | rereMapper.deleteById(records.getId()); |
| | | break; |
| | | } |
| | | if ("SUCCESS".equals(s)) { |
| | | records.setPayStatus(2); |
| | | records.setOrderNumber(transaction_id); |
| | | rereMapper.updateById(records); |
| | | break; |
| | | } |
| | | if ("USERPAYING".equals(s)) { |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return weixinpay; |
| | | |
| | | } |
| | |
| | | public ResultUtil addRechargeCallbackPay(String code, String orderNumber) { |
| | | RechargeRecords rechargeRecords = this.baseMapper.selectOne(new QueryWrapper<RechargeRecords>() |
| | | .eq("code", code)); |
| | | if (rechargeRecords.getPayStatus() == 2) { |
| | | if (null == rechargeRecords || rechargeRecords.getPayStatus() == 2) { |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | TAppUser tAppUser = tappMapper.selectById(rechargeRecords.getAppUserId()); |
| | | tAppUser.setPlayPaiCoins(null == tAppUser.getPlayPaiCoins() ? rechargeRecords.getPlayPaiCoins() : tAppUser.getPlayPaiCoins() + rechargeRecords.getPlayPaiCoins()); |
| | | tappMapper.updateById(tAppUser); |
| | | |
| | | rechargeRecords.setAppUserId(null); |
| | | rechargeRecords.setPayStatus(2); |
| | | rechargeRecords.setPayTime(new Date()); |
| | | rechargeRecords.setOrderNumber(orderNumber); |
| | | this.baseMapper.updateById(rechargeRecords); |
| | | |
| | | TAppUser tAppUser = tappMapper.selectById(rechargeRecords.getAppUserId()); |
| | | tAppUser.setPlayPaiCoins(null == tAppUser.getPlayPaiCoins() ? rechargeRecords.getPlayPaiCoins() : tAppUser.getPlayPaiCoins() + rechargeRecords.getPlayPaiCoins()); |
| | | tappMapper.updateById(tAppUser); |
| | | return null; |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private HonorDeClient honorDeClient; |
| | | |
| | | @Autowired |
| | | private TStudentService studentService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private HonorRulesClient honorRulesClient; |
| | | |
| | | @Resource |
| | | private WorldCupCompetitorClient worldCupCompetitorClient; |
| | | |
| | | @Autowired |
| | | private StudentHonorService studentHonorService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<GongVo> queryStuOfMedalData(Integer stuId) { |
| | | public List<GongVo> queryStuOfMedalData(Integer stuId, Integer appUserId) { |
| | | List<GongVo> voList = new ArrayList<>(); |
| | | // List<StudentHonor> studentHonors = this.baseMapper.selectList(new QueryWrapper<StudentHonor>() |
| | | // .eq("stuId", stuId)); |
| | | // |
| | | TStudent student = studentService.getById(stuId); |
| | | // |
| | | // |
| | | // if (studentHonors.size() > 0){ |
| | | // studentHonors.forEach( stuoHo -> { |
| | | // GongVo vo = new GongVo(); |
| | | // vo.setMedalType(stuoHo.getHonorType()); |
| | | // switch (stuoHo.getHonorType()){ |
| | | // case 1: |
| | | // vo.setMedalName("俱乐部之星"); |
| | | // break; |
| | | // case 2: |
| | | // vo.setMedalName("运动达人"); |
| | | // break; |
| | | // case 3: |
| | | // vo.setMedalName("社区之王"); |
| | | // break; |
| | | // case 4: |
| | | // vo.setMedalName("深度玩家"); |
| | | // break; |
| | | // default: |
| | | // break; |
| | | // } |
| | | // voList.add(vo); |
| | | // }); |
| | | // } |
| | | Integer count1 = coursePackageClient.counts(stuId); |
| | | if (count1 > 0) { |
| | | GongVo vo = new GongVo(); |
| | |
| | | } |
| | | |
| | | Integer count5 = worldCupCompetitorClient.winCount(stuId); |
| | | if (count5 > 0) { |
| | | |
| | | StudentHonor one = studentHonorService.getOne(new QueryWrapper<StudentHonor>() |
| | | .eq("appUserId", appUserId).eq("honorType", 5)); |
| | | if (null != one) { |
| | | GongVo vo = new GongVo(); |
| | | vo.setMedalType(5); |
| | | vo.setMedalName("常胜将军"); |
| | | voList.add(vo); |
| | | } |
| | | |
| | | Integer count6 = worldCupCompetitorClient.count(stuId); |
| | | if (count6 > 0) { |
| | | one = studentHonorService.getOne(new QueryWrapper<StudentHonor>() |
| | | .eq("appUserId", appUserId).eq("honorType", 6)); |
| | | if (null != one) { |
| | | GongVo vo = new GongVo(); |
| | | vo.setMedalType(6); |
| | | vo.setMedalName("越战越勇"); |
| | |
| | | vo.setLevelNum(Integer.valueOf(honorRules.getLevel()) - 1); |
| | | vo.setNextLevel(Integer.valueOf(honorRules.getLevel())); |
| | | vo.setUpgradeConditions(String.valueOf(Integer.valueOf(honorRules.getCondition()) - studentHonor.getNumber())); |
| | | vo.setIsTopLevel(0); |
| | | vo.setIsTopLevel(2); |
| | | } else { |
| | | vo.setLevelNum(10); |
| | | vo.setNextLevel(10); |
| | | vo.setIsTopLevel(1); |
| | | } |
| | | list.add(vo); |
| | |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("-" + cupPayment.getAmount()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | }else{ |
| | | consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("-" + cupPayment.getAmount()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | |
| | | consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_WORLD_CIP_PAYMENT.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(cupPayment.getCreateTime())); |
| | | consumeDetail.setConsumeAmount("+" + cupPayment.getRefundAmount()); |
| | | consumeDetail.setType(1); |
| | | details.add(consumeDetail); |
| | | } |
| | | details.add(consumeDetail); |
| | | } |
| | | |
| | | return details; |
| | |
| | | case 1: |
| | | try { |
| | | if (merchandise.getType() == 2) { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | return WechatPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | } else { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | return WechatPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | } |
| | | } catch (Exception e) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | | case 2: |
| | | if (merchandise.getType() == 2) { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code, returnId); |
| | | return AlipayPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code, returnId); |
| | | } else { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code, returnId); |
| | | return AlipayPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(goodsNums)), code, returnId); |
| | | } |
| | | default: |
| | | break; |
| | |
| | | case 1: |
| | | try { |
| | | if (merchandise.getType() == 2) { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | return WechatPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | } else { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | return WechatPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | } |
| | | } catch (Exception e) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | | case 2: |
| | | if (merchandise.getType() == 2) { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code, returnId); |
| | | return AlipayPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code, returnId); |
| | | } else { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code, returnId); |
| | | return AlipayPayment(merchandise.getType(), merchandise.getCash().multiply(new BigDecimal(goodsNums)), code, returnId); |
| | | } |
| | | default: |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code, Long returnId) { |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid,"优惠卷", "优惠卷", String.valueOf(returnId), code, cash.toString(), |
| | | private ResultUtil AlipayPayment(Integer type, BigDecimal cash, String code, Long returnId) { |
| | | String name = (type == 1 ? "购买实体商品" : type == 2 ? "报名运动营": type == 3 ? "购买门票" : "购买优惠券"); |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid,name, name, String.valueOf(returnId), code, cash.toString(), |
| | | "/base/pointMer/exchangeGoodPaymentAliCallback"); |
| | | if (alipay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | |
| | | } |
| | | |
| | | |
| | | private ResultUtil WechatPayment(BigDecimal cash, String code) throws Exception { |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("课包", "", code, cash.toString(), |
| | | private ResultUtil WechatPayment(Integer type, BigDecimal cash, String code) throws Exception { |
| | | String name = (type == 1 ? "购买实体商品" : type == 2 ? "报名运动营": type == 3 ? "购买门票" : "购买优惠券"); |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay(name, "", code, cash.toString(), |
| | | "/base/pointMer/exchangeGoodPaymentWeChatCallback", "APP", ""); |
| | | if (weixinpay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/worldCup/editWorldCup") |
| | | public Integer editWorldCup(@RequestBody WorldCup worldCup){ |
| | | String lon = worldCup.getLon(); |
| | | String lat = worldCup.getLat(); |
| | | public Integer editWorldCup(@RequestBody String worldCup){ |
| | | WorldCup worldCup2 = JSON.parseObject(worldCup, WorldCup.class); |
| | | String lon = worldCup2.getLon(); |
| | | String lat = worldCup2.getLat(); |
| | | Map<String, String> geocode = null; |
| | | try { |
| | | geocode = gdMapGeocodingUtil.geocode(lon, lat); |
| | |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String city = geocode.get("city"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | worldCup.setProvince(province.replace("省", "")); |
| | | worldCup.setProvinceCode(provinceCode); |
| | | worldCup.setCity(city.replace("市", "")); |
| | | worldCup.setCityCode(cityCode); |
| | | WorldCup worldCup1 = worldCupService.getById(worldCup.getId()); |
| | | worldCup.setCreateTime(worldCup1.getCreateTime()); |
| | | worldCup.setMatchNumber(worldCup1.getMatchNumber()); |
| | | worldCupService.updateWorldCupAll(worldCup); |
| | | return worldCup.getId(); |
| | | worldCup2.setProvince(province.replace("省", "")); |
| | | worldCup2.setProvinceCode(provinceCode); |
| | | worldCup2.setCity(city.replace("市", "")); |
| | | worldCup2.setCityCode(cityCode); |
| | | WorldCup worldCup1 = worldCupService.getById(worldCup2.getId()); |
| | | worldCup2.setCreateTime(worldCup1.getCreateTime()); |
| | | worldCup2.setMatchNumber(worldCup1.getMatchNumber()); |
| | | worldCupService.updateWorldCupAll(worldCup2); |
| | | return worldCup2.getId(); |
| | | } |
| | | |
| | | |
| | |
| | | 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()) |
| | | List<WorldCupPayment> list = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("appUserId", getWorldCupPayment.getAppUserId()) |
| | | .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")); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.HH.dd HH:mm"); |
| | | for (WorldCupCompetitor cupCompetitor : list) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", cupCompetitor.getId()); |
| | | map.put("id", cupCompetitor.getId().toString()); |
| | | if(1 == participantType){ |
| | | TStudent tStudent = studentClient.queryById(participantId.intValue()); |
| | | if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){ |
| | |
| | | map.put("name", participant.getName()); |
| | | } |
| | | map.put("startTime", sdf.format(cupCompetitor.getStartTime())); |
| | | map.put("score", cupCompetitor.getOurScore().compareTo(cupCompetitor.getOpponentScore()) > 0 ? |
| | | cupCompetitor.getOurScore() + ":" + cupCompetitor.getOpponentScore() : |
| | | cupCompetitor.getOpponentScore() + ":" + cupCompetitor.getOurScore()); |
| | | map.put("score", cupCompetitor.getOurScore() + ":" + cupCompetitor.getOpponentScore()); |
| | | map.put("matchResult", cupCompetitor.getMatchResult() == 1 ? "胜" : cupCompetitor.getMatchResult() == 0 ? "平" : "负"); |
| | | map.put("blue", cupCompetitor.getParticipant() == 1 ? cupCompetitor.getOurScore() : cupCompetitor.getOpponentScore()); |
| | | map.put("red", cupCompetitor.getParticipant() == 2 ? cupCompetitor.getOurScore() : cupCompetitor.getOpponentScore()); |
| | | mapList.add(map); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | Integer red = changeScore.getRed(); |
| | | WorldCupCompetitor worldCupCompetitor = this.getById(id); |
| | | List<WorldCupCompetitor> blueList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()) |
| | | .eq("participant", 1)); |
| | | .eq("participant", 1).eq("worldCupId", worldCupCompetitor.getWorldCupId())); |
| | | WorldCup worldCup = worldCupService.getById(blueList.get(0).getWorldCupId()); |
| | | for (WorldCupCompetitor cupCompetitor : blueList) { |
| | | //如果之前输了,现在赢/平了,需要增加积分 |
| | |
| | | } |
| | | cupCompetitor.setOurScore(blue); |
| | | cupCompetitor.setOpponentScore(red); |
| | | cupCompetitor.setWorldCupId(null); |
| | | } |
| | | this.updateBatchById(blueList); |
| | | |
| | | List<WorldCupCompetitor> redList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()).eq("participant", 2)); |
| | | List<WorldCupCompetitor> redList = this.list(new QueryWrapper<WorldCupCompetitor>().eq("code", worldCupCompetitor.getCode()) |
| | | .eq("participant", 2).eq("worldCupId", worldCupCompetitor.getWorldCupId())); |
| | | for (WorldCupCompetitor cupCompetitor : redList) { |
| | | //如果之前输了,现在赢/平了,需要增加积分 |
| | | if(cupCompetitor.getMatchResult() == -1 && (red.compareTo(blue) > 0 || red.compareTo(blue) == 0)){ |
| | |
| | | } |
| | | cupCompetitor.setOurScore(red); |
| | | cupCompetitor.setOpponentScore(blue); |
| | | cupCompetitor.setWorldCupId(null); |
| | | } |
| | | this.updateBatchById(blueList); |
| | | this.updateBatchById(redList); |
| | | |
| | | |
| | | //修改勋章 |
| | |
| | | return ResultUtil.error("微信退款失败"); |
| | | }else{ |
| | | worldCupPayment.setRefundAmount(multiply); |
| | | worldCupPayment.setWorldCupId(null); |
| | | this.updateById(worldCupPayment); |
| | | } |
| | | } |
| | |
| | | ids.add(worldCupCompetitor.getId()); |
| | | //已参赛 |
| | | if(0 == worldCupPaymentParticipant.getAlreadyEntered()){ |
| | | worldCupPaymentParticipant.setWorldCupId(null); |
| | | worldCupPaymentParticipant.setAlreadyEntered(1); |
| | | worldCupPaymentParticipantService.updateById(worldCupPaymentParticipant); |
| | | } |
| | |
| | | |
| | | List<CoursePackageOrderStudent> coursePackageOrderStudent = coursePackageOrderStudentClient.getCoursePackageOrderUser(paymentWorldCup.getUid()); |
| | | int sum = coursePackageOrderStudent.stream().mapToInt(CoursePackageOrderStudent::getLaveClassHours).sum(); |
| | | if(sum < worldCup.getClassHour()){ |
| | | if(sum < worldCup.getClassHour() * num){ |
| | | return ResultUtil.error("报名失败,课时不足,请续课!"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | WorldCup worldCup = this.getById(id); |
| | | worldCup.setStatus(4); |
| | | this.updateById(worldCup); |
| | | } |
| | | |
| | | |
| | |
| | | participantVo.setBirthday(format); |
| | | } |
| | | participantVo.setGender(participant.getGender()); |
| | | // if (participant.getIdcard() == null || participant.getIdcard().isEmpty()) { |
| | | // listVo1.add(participantVo); |
| | | // continue; |
| | | // } |
| | | linkedHashMap.put(participant.getName(), participantVo); |
| | | if (participant.getIdcard() == null || participant.getIdcard().isEmpty()) { |
| | | listVo1.add(participantVo); |
| | | continue; |
| | | } |
| | | linkedHashMap.put(participant.getIdcard(), participantVo); |
| | | } |
| | | |
| | | for (TStudent tStudent : tStudents) { |
| | |
| | | } |
| | | participantVo.setGender(tStudent.getSex()); |
| | | participantVo.setIsStudent(1); |
| | | // if (tStudent.getIdCard() == null || tStudent.getIdCard().isEmpty()) { |
| | | // listVo1.add(participantVo); |
| | | // continue; |
| | | // } |
| | | linkedHashMap.put(tStudent.getName(), participantVo); |
| | | if (tStudent.getIdCard() == null || tStudent.getIdCard().isEmpty()) { |
| | | listVo1.add(participantVo); |
| | | continue; |
| | | } |
| | | linkedHashMap.put(tStudent.getIdCard(), participantVo); |
| | | } |
| | | listVo1.addAll(linkedHashMap.values()); |
| | | return listVo1; |
| | |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseAmount("+" + cspackage.getClassHours()); |
| | | recordVo.setPurchaseTime(format.format(cspackage.getInsertTime())); |
| | | recordVo.setPurchaseType("购买课包"); |
| | | recordVo.setPurchaseType("报名运动营"); |
| | | purchaseRecordVos.add(recordVo); |
| | | }); |
| | | } |
| | |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(packagePayment.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsum.setReason("报名运动营"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | } catch (Exception e) { |
| | |
| | | coursePackageOrderService.updateById(coursePackageOrder); |
| | | } |
| | | |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("购买课程", coursePackagePaymentConfig.getId().toString(), code, paymentPrice.toString(), "/base/course/weChatPaymentCourseCallback", "APP", ""); |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("报名运动营", coursePackagePaymentConfig.getId().toString(), code, paymentPrice.toString(), "/base/course/weChatPaymentCourseCallback", "APP", ""); |
| | | if (weixinpay.getCode() == 200) { |
| | | String finalCode = code; |
| | | new Thread(new Runnable() { |
| | |
| | | smid1 = storeClient.getSMIDByOperatorId(store.getOperatorId()); |
| | | } |
| | | } |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid1,"购买课程", "购买课程", |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid1,"报名运动营", "报名运动营", |
| | | coursePackagePaymentConfig.getId().toString(), |
| | | code, paymentPrice.toString(), "/base/course/aliPaymentCourseCallback"); |
| | | if (alipay.getCode() == 200) { |
| | |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsum.setReason("报名运动营"); |
| | | courseCounsumService.save(courseCounsum); |
| | | //账单记录 |
| | | if(coursePackageOrder.getPayType() != 3){ |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | |
| | | * @Date 2024/2/18 16:58 |
| | | */ |
| | | @Data |
| | | public class WorldCup { |
| | | public class WorldCup implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1905122041950251207L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | |
| | | import com.dsh.course.feignClient.communityWorldCup.Model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | * @return 数据id |
| | | */ |
| | | @PostMapping("/worldCup/editWorldCup") |
| | | void editWorldCup(WorldCup worldCup); |
| | | void editWorldCup(@RequestBody String worldCup); |
| | | |
| | | |
| | | /** |
| | |
| | | }else{ |
| | | worldCup.setStatus(1); |
| | | } |
| | | worldCupClient.editWorldCup(worldCup); |
| | | worldCupClient.editWorldCup(JSON.toJSONString(worldCup)); |
| | | worldCupStoreClient.delWorldCupStore(worldCup.getId()); |
| | | JSONArray jsonArray = JSON.parseArray(stores); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | |
| | | WorldCup worldCup = new WorldCup(); |
| | | worldCup.setId(id); |
| | | worldCup.setStatus(state); |
| | | worldCupClient.editWorldCup(worldCup); |
| | | worldCupClient.editWorldCup(JSON.toJSONString(worldCup)); |
| | | //开始处理已支付的退费 |
| | | worldCupClient.cancelWorldCupRefund(id); |
| | | return ResultUtil.success(); |
| | |
| | | |
| | | # \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0479\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | feign.compression.request.mime-types=text/xml,application/xml,application/json |
| | | feign.compression.request.min-request-size=4096 |
| | | feign.compression.request.min-request-size=2048 |
| | | feign.compression.request.enabled=true |
| | | feign.compression.response.enabled=true |
| | | |
| | |
| | | {title: '比分', field: 'score', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '结果', field: 'matchResult', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return '<a href="#" onclick="WorldCupGameStatisticsListInfo.changeScore(\'' + data + '\')" style="color:blue;">修改比分</a>'; |
| | | formatter:function (data, item) { |
| | | return '<a href="#" onclick="WorldCupGameStatisticsListInfo.changeScore(\'' + data + '\',' + item.blue + ',' + item.red + ')" style="color:blue;">修改比分</a>'; |
| | | } |
| | | }, |
| | | ]; |
| | |
| | | /** |
| | | * 商户号认证 |
| | | */ |
| | | WorldCupGameStatisticsListInfo.changeScore = function (id) { |
| | | WorldCupGameStatisticsListInfo.changeScore = function (id, blue, red) { |
| | | const str = '<div class="row">\n' + |
| | | ' <div class="form-group" style="height: 50px;">\n' + |
| | | ' <label class="col-sm-3 control-label" style="text-align: right;">蓝方得分:</label>' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input id="blue" class="form-control" type="number" min="0"/>\n' + |
| | | ' <input id="blue" class="form-control" type="number" min="0" value="' + blue + '"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group" style="height: 50px;">\n' + |
| | | ' <label class="col-sm-3 control-label" style="text-align: right;">红方得分:</label>' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input id="red" class="form-control" type="number" min="0"/>\n' + |
| | | ' <input id="red" class="form-control" type="number" min="0" value="' + red + '"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' |
| | |
| | | var ajax = new $ax(Feng.ctxPath + "/worldCupRecords/changeScore", function (res) { |
| | | if (res.code==200){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.WorldCupGameStatisticsInfo.refresh(); |
| | | WorldCupGameStatisticsListInfo.close(); |
| | | WorldCupGameStatisticsListInfo.search(); |
| | | layer.closeAll(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | |
| | | public HonorRules getHonor(@RequestBody List<Integer> integers) { |
| | | HonorRules one = honorRulesService.getOne(new QueryWrapper<HonorRules>() |
| | | .eq("type", integers.get(0)) |
| | | .le("`condition`", integers.get(1)).orderByDesc("condition") |
| | | .le("`condition`", integers.get(1)).orderByDesc("`condition`") |
| | | .last("LIMIT 1")); |
| | | |
| | | if (one == null) { |
| | |
| | | private String siteTime; |
| | | |
| | | @ApiModelProperty(value = "价格") |
| | | private double price; |
| | | private Double price; |
| | | |
| | | } |