nickchange
2023-10-27 cc30fb569674fa8f82130253b68ac609ae5d8eb6
cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java
@@ -125,7 +125,18 @@
                HashMap<String, Object> map = new HashMap<>();
                Store store = storeClient.queryStoreById(Integer.valueOf(s));
                map.put("name",store.getName());
                map.put("address",store.getAddress());
                String str = store.getAddress();
                str = str.substring(str.indexOf("省") + 1);
                // 去掉第一个“市”及之前的字符串
                str = str.substring(str.indexOf("市") + 1);
                // 去掉第一个“区”及之前的字符串
                str = str.substring(str.indexOf("区") + 1);
                map.put("address",str);
                map.put("storeLon",store.getLon());
                map.put("storeLat",store.getLat());
                map.put("storeCoverDrawing",store.getCoverDrawing());
@@ -196,6 +207,10 @@
        AppUser appUser = appUserClient.queryAppUser(uid);
        String[] split = paymentCompetitionVo.getIds().split(";");
        Competition competition = this.getById(paymentCompetitionVo.getId());
        if ((competition.getBaseNumber()+split.length)>competition.getApplicantsNumber()){
            return ResultUtil.error("报名人数超过最大限制");
        }
        BigDecimal money = null;
        if(paymentCompetitionVo.getPayType() == 1 || paymentCompetitionVo.getPayType() == 2){
            money = new BigDecimal(competition.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN);
@@ -283,7 +298,7 @@
            paymentCompetition.setPayOrderNo("");
            paymentCompetitionService.updateById(paymentCompetition);
            competition.setApplicantsNumber(competition.getApplicantsNumber() + 1);
            competition.setBaseNumber(competition.getBaseNumber() + 1);
            this.updateById(competition);
        }
        return ResultUtil.success();