puzhibing
2024-03-15 b3e0d0ea6c1e311566bab861b79cc9b9c6d25287
修改bug
50个文件已修改
2个文件已添加
679 ■■■■ 已修改文件
cloud-server-account/src/main/java/com/dsh/account/controller/RefereeController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/entity/HonorRules.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/feignclient/communityWorldCup/model/GetWorldCupPayment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/feignclient/other/model/HonorRules.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/model/WorldCupPayment.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/model/vo/medalDetail/GongVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/model/vo/medalDetail/StuMedalVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/service/impl/RechargeRecordsServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/resources/mapper/RefereeMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/entity/WorldCupPayment.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/feignclient/account/StudentHonorClient.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/feignclient/account/model/StudentHonor.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/feignclient/course/CoursePackageOrderStudentClient.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/GetWorldCupPayment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/MyWorldCupInfo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/WorldCupListCoachVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/WorldCupRank.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupPaymentParticipantService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupPaymentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/util/PayMoneyUtil.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupCompetitorMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupPaymentParticipantMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/model/ParticipantVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/service/impl/ParticipantServiceImpl.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-competition/src/main/java/com/dsh/competition/util/PayMoneyUtil.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackageOrderStudentController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-course/src/main/java/com/dsh/course/service/impl/CoursePackageOrderStudentServiceImpl.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-course/src/main/java/com/dsh/course/util/PayMoneyUtil.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/communityWorldCup/WorldCupStoreClient.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/HonorRules.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/tHonor/THonor.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/worldCup/worldCup_info.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/tHonor/THonor.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/worldCup/worldCup.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/worldCupRecords/worldCupRecords.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/controller/HonorController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/entity/HonorRules.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/feignclient/model/StuMedalVo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/controller/RefereeController.java
@@ -69,7 +69,7 @@
     * @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));
    }
cloud-server-account/src/main/java/com/dsh/account/entity/HonorRules.java
@@ -31,7 +31,7 @@
    @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;
cloud-server-account/src/main/java/com/dsh/account/feignclient/communityWorldCup/model/GetWorldCupPayment.java
@@ -18,7 +18,7 @@
    /**
     * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时)
     */
    private Integer payType;
    private String payType;
    /**
     * 开始时间
     */
cloud-server-account/src/main/java/com/dsh/account/feignclient/other/model/HonorRules.java
@@ -7,7 +7,7 @@
public class HonorRules {
    private Integer id;
    /**
     * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)
     * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=常胜将军,6=越战越勇)
     */
    private Integer type;
    /**
cloud-server-account/src/main/java/com/dsh/account/model/WorldCupPayment.java
@@ -67,6 +67,11 @@
     */
    private String refundOrderNo;
    /**
     * 退款金额
     */
    @TableField("refundAmount")
    private BigDecimal refundAmount;
    /**
     * 状态(1=正常,2=冻结,3=删除)
     */
    private Integer state;
cloud-server-account/src/main/java/com/dsh/account/model/vo/medalDetail/GongVo.java
@@ -6,7 +6,7 @@
@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 = "勋章名称 例如:俱乐部之星")
cloud-server-account/src/main/java/com/dsh/account/model/vo/medalDetail/StuMedalVo.java
@@ -7,7 +7,7 @@
@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 = "勋章名称 例如:俱乐部之星")
cloud-server-account/src/main/java/com/dsh/account/service/impl/RechargeRecordsServiceImpl.java
@@ -205,21 +205,21 @@
        //世界杯
        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);
cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java
@@ -133,7 +133,7 @@
        if (count5 > 0) {
            GongVo vo = new GongVo();
            vo.setMedalType(5);
            vo.setMedalName("赢家");
            vo.setMedalName("常胜将军");
            voList.add(vo);
        }
@@ -141,7 +141,7 @@
        if (count6 > 0) {
            GongVo vo = new GongVo();
            vo.setMedalType(6);
            vo.setMedalName("次数");
            vo.setMedalName("越战越勇");
            voList.add(vo);
        }
@@ -170,10 +170,10 @@
                    vo.setMedalName("深度玩家");
                    break;
                case 5:
                    vo.setMedalName("赢家");
                    vo.setMedalName("常胜将军");
                    break;
                case 6:
                    vo.setMedalName("次数");
                    vo.setMedalName("越战越勇");
                    break;
            }
            //拿到当前对应的rule对象
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -20,6 +20,8 @@
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;
@@ -180,6 +182,9 @@
    @Autowired
    private IRefereeService refereeService;
    @Resource
    private WorldCupPaymentClinet worldCupPaymentClinet;
@@ -947,6 +952,30 @@
                        .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;
    }
cloud-server-account/src/main/java/com/dsh/account/util/PayMoneyUtil.java
@@ -68,14 +68,15 @@
    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";//支付回调网关地址
@@ -408,7 +409,7 @@
        }
        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);
cloud-server-account/src/main/resources/mapper/RefereeMapper.xml
@@ -22,7 +22,7 @@
            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>
@@ -42,7 +42,7 @@
            and provinceCode = #{item.provinceCode}
        </if>
        <if test="null != item.cityCode and '' != item.cityCode">
            and cityCode = #{cityCode}
            and cityCode = #{item.cityCode}
        </if>
    </select>
</mapper>
cloud-server-activity/src/main/java/com/dsh/activity/controller/PointMercharsController.java
@@ -226,10 +226,12 @@
                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);
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
@@ -10,10 +10,12 @@
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;
@@ -91,6 +93,12 @@
    @Autowired
    private IWorldCupPaymentService worldCupPaymentService;
    @Resource
    private GameClient gameClient;
    /**
     * 根据门店id获取门店关系数据
@@ -189,7 +197,7 @@
                .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());
@@ -240,9 +248,15 @@
        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);
    }
@@ -397,11 +411,10 @@
            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{
@@ -498,12 +511,12 @@
    @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);
    }
@@ -512,10 +525,10 @@
    @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);
    }
@@ -741,6 +754,7 @@
            worldCupPayment.setRefundOrderNo(refund_id);
            worldCupPayment.setRefundTime(new Date());
            worldCupPayment.setPayStatus(3);
            worldCupPayment.setWorldCupId(null);
            worldCupPaymentService.updateById(worldCupPayment);
            PrintWriter out = null;
            try {
@@ -872,8 +886,9 @@
    @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"));
    }
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/entity/WorldCupPayment.java
@@ -77,6 +77,11 @@
    @TableField("refundOrderNo")
    private String refundOrderNo;
    /**
     * 退款金额
     */
    @TableField("refundAmount")
    private BigDecimal refundAmount;
    /**
     * 状态(1=正常,2=冻结,3=删除)
     */
    @TableField("state")
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/feignclient/account/StudentHonorClient.java
New file
@@ -0,0 +1,20 @@
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);
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/feignclient/account/model/StudentHonor.java
New file
@@ -0,0 +1,19 @@
package com.dsh.communityWorldCup.feignclient.account.model;
import lombok.Data;
@Data
public class StudentHonor {
    /**
     * 用户id
     */
    private Integer appUserId;
    /**
     * 荣耀类型
     */
    private Integer honorType;
    /**
     * 当前次数
     */
    private Integer number;
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/feignclient/course/CoursePackageOrderStudentClient.java
@@ -17,7 +17,7 @@
    /**
     * 根据学院id获取剩余有效课时数据
     * 根据学员id获取剩余有效课时数据
     * @param studentId
     * @return
     */
@@ -26,6 +26,16 @@
    /**
     * 根据用户id获取剩余有效课时数据
     * @param appUserId
     * @return
     */
    @PostMapping("/coursePackageOrderStudent/getCoursePackageOrderUser")
    List<CoursePackageOrderStudent> getCoursePackageOrderUser(Integer appUserId);
    /**
     * 扣减学员课时
     * @param deductionClassHourList
     */
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/GetWorldCupPayment.java
@@ -18,7 +18,7 @@
    /**
     * 支付方式(0=免费,1=微信,2=支付宝,3=玩湃币,4=课时)
     */
    private Integer payType;
    private String payType;
    /**
     * 开始时间
     */
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/MyWorldCupInfo.java
@@ -15,7 +15,7 @@
@ApiModel
public class MyWorldCupInfo {
    @ApiModelProperty("世界杯id")
    private Integer id;
    private Long id;
    @ApiModelProperty("图片")
    private String infoImg;
    @ApiModelProperty("名称")
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/WorldCupListCoachVo.java
@@ -23,4 +23,5 @@
    private Integer status;
    private String lon;
    private String lat;
    private Double distance;
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/WorldCupRank.java
@@ -12,7 +12,7 @@
@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")
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupPaymentParticipantService.java
@@ -39,7 +39,7 @@
     * @param id
     * @return
     */
    MyWorldCupInfo getMyWorldCupInfo(String id, String lon, String lat);
    MyWorldCupInfo getMyWorldCupInfo(Long id, String lon, String lat);
    /**
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupPaymentService.java
@@ -16,5 +16,5 @@
     * @param id
     * @return
     */
    ResultUtil cancelMyWorldCup(String id);
    ResultUtil cancelMyWorldCup(Long id);
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java
@@ -7,11 +7,9 @@
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;
@@ -53,6 +51,9 @@
    @Resource
    private UserIntegralChangesClient userIntegralChangesClient;
    @Resource
    private StudentHonorClient studentHonorClient;
@@ -207,7 +208,7 @@
                    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{
@@ -222,7 +223,7 @@
            }
            //排名前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);
@@ -317,6 +318,28 @@
        }
        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);
        }
    }
@@ -347,11 +370,11 @@
            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();
@@ -575,6 +598,30 @@
            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);
        }
    }
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java
@@ -120,7 +120,7 @@
     * @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());
@@ -128,6 +128,7 @@
        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());
@@ -202,6 +203,24 @@
            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;
    }
@@ -217,8 +236,8 @@
                .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));
@@ -239,6 +258,7 @@
                    participantVo.setPhone(tStudent.getPhone());
                    participantVo.setIsStudent(1);
                    datas.add(participantVo);
                    xy.add(participantId);
                }
                //参赛人员
                if(2 == participantType && !csry.contains(participantId)){
@@ -252,6 +272,7 @@
                    participantVo.setPhone(participant.getPhone());
                    participantVo.setIsStudent(0);
                    datas.add(participantVo);
                    csry.add(participantId);
                }
            }
        }
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentServiceImpl.java
@@ -59,7 +59,7 @@
     * @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());
@@ -79,6 +79,7 @@
        }
        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){
@@ -88,6 +89,9 @@
                System.err.println("-------------微信退款失败---------");
                System.err.println(map.get("return_msg"));
                return ResultUtil.error("微信退款失败");
            }else{
                worldCupPayment.setRefundAmount(multiply);
                this.updateById(worldCupPayment);
            }
        }
        //支付宝支付
@@ -104,6 +108,7 @@
                worldCupPayment.setRefundTime(new Date());
                worldCupPayment.setRefundOrderNo(trade_no);
                worldCupPayment.setPayStatus(3);
                worldCupPayment.setRefundAmount(multiply);
                this.updateById(worldCupPayment);
            }
        }
@@ -117,6 +122,7 @@
            worldCupPayment.setRefundTime(new Date());
            worldCupPayment.setRefundOrderNo("");
            worldCupPayment.setPayStatus(3);
            worldCupPayment.setRefundAmount(multiply);
            this.updateById(worldCupPayment);
        }
        //课时支付
@@ -130,6 +136,7 @@
            worldCupPayment.setRefundTime(new Date());
            worldCupPayment.setRefundOrderNo("");
            worldCupPayment.setPayStatus(3);
            worldCupPayment.setRefundAmount(multiply);
            this.updateById(worldCupPayment);
        }
        return ResultUtil.success();
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
@@ -89,15 +89,22 @@
    @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;
@@ -165,8 +172,10 @@
            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);
@@ -220,6 +229,9 @@
     */
    @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());
@@ -233,8 +245,12 @@
            worldCupListVo.setHeat(heat);
            String lat = worldCupListVo.getLat();
            String lon = worldCupListVo.getLon();
            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);
            }
        }
@@ -324,6 +340,25 @@
            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;
    }
@@ -404,6 +439,10 @@
            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("已超出最大报名人数");
            }
        }
@@ -550,25 +589,43 @@
                BigDecimal multiply = new BigDecimal(num).multiply(new BigDecimal(worldCup.getClassHour()));
                String ids = paymentWorldCup.getIds();
                JSONArray jsonArray = JSON.parseArray(ids);
                List<DeductionClassHour> list = new ArrayList<>();
                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());
                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);
                    //是否是学员(0=否,1=是)
                    Integer isStudent = jsonObject.getInteger("isStudent");
                    if(0 == isStudent){
                        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){
@@ -578,6 +635,7 @@
                            deductionClassHour.setClassHour(laveClassHours);
                            deductionClassHour.setStudentId(packageOrderStudent.getStudentId());
                            deductionClassHour.setCoursePackageId(packageOrderStudent.getCoursePackageId());
                            packageOrderStudent.setLaveClassHours(0);
                            list.add(deductionClassHour);
                        }else{
                            //够扣除直接跳出进行下个学员
@@ -585,6 +643,7 @@
                            deductionClassHour.setClassHour(classHour);
                            deductionClassHour.setStudentId(packageOrderStudent.getStudentId());
                            deductionClassHour.setCoursePackageId(packageOrderStudent.getCoursePackageId());
                            packageOrderStudent.setLaveClassHours(laveClassHours - classHour);
                            list.add(deductionClassHour);
                            break;
                        }
@@ -604,29 +663,6 @@
                    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);
                }
@@ -674,8 +710,11 @@
    @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);
        //添加报名明细
@@ -688,7 +727,7 @@
            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);
@@ -734,22 +773,14 @@
     */
    @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(),
@@ -757,6 +788,9 @@
                if(!"SUCCESS".equals(map.get("return_code"))){
                    System.err.println("-------------微信退款失败---------");
                    System.err.println(map.get("return_msg"));
                }else{
                    worldCupPayment.setRefundAmount(multiply);
                    worldCupPaymentService.updateById(worldCupPayment);
                }
            }
            //支付宝支付
@@ -772,6 +806,7 @@
                    worldCupPayment.setWorldCupId(null);
                    worldCupPayment.setRefundTime(new Date());
                    worldCupPayment.setRefundOrderNo(trade_no);
                    worldCupPayment.setRefundAmount(multiply);
                    worldCupPayment.setPayStatus(3);
                    worldCupPaymentService.updateById(worldCupPayment);
                }
@@ -785,13 +820,14 @@
                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);
                }
@@ -799,8 +835,10 @@
                worldCupPayment.setRefundTime(new Date());
                worldCupPayment.setRefundOrderNo("");
                worldCupPayment.setPayStatus(3);
                worldCupPayment.setRefundAmount(multiply);
                worldCupPaymentService.updateById(worldCupPayment);
            }
        }
    }
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/util/PayMoneyUtil.java
@@ -49,15 +49,15 @@
    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";//应用公钥证书路径
@@ -65,7 +65,9 @@
    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";//微信证书
    /**
@@ -359,7 +361,7 @@
        }
        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);
@@ -718,6 +720,7 @@
                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;
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupCompetitorMapper.xml
@@ -106,8 +106,22 @@
    <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,
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupMapper.xml
@@ -13,7 +13,7 @@
        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>
@@ -28,7 +28,7 @@
        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,
@@ -59,7 +59,7 @@
        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,
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupPaymentParticipantMapper.xml
@@ -7,7 +7,7 @@
    <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>
@@ -19,7 +19,7 @@
        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,
cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java
@@ -136,14 +136,13 @@
                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) {
cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java
@@ -22,6 +22,8 @@
    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)
cloud-server-competition/src/main/java/com/dsh/competition/model/ParticipantVo.java
@@ -1,5 +1,6 @@
package com.dsh.competition.model;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -15,6 +16,8 @@
    private Integer id;
    @ApiModelProperty("姓名")
    private String name;
    @ApiModelProperty("姓名")
    private String headImg;
    @ApiModelProperty("年龄")
    private Integer age;
    @ApiModelProperty("身份证号码")
cloud-server-competition/src/main/java/com/dsh/competition/service/impl/ParticipantServiceImpl.java
@@ -121,33 +121,34 @@
            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) {
@@ -162,6 +163,7 @@
            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());
@@ -169,20 +171,13 @@
            }
            participantVo.setGender(tStudent.getSex());
            participantVo.setIsStudent(1);
            if (tStudent.getIdCard() == null || tStudent.getIdCard().isEmpty()) {
                listVo1.add(participantVo);
                continue;
//            if (tStudent.getIdCard() == null || tStudent.getIdCard().isEmpty()) {
//                listVo1.add(participantVo);
//                continue;
//            }
            linkedHashMap.put(tStudent.getName(), participantVo);
            }
            linkedHashMap.put(tStudent.getIdCard(), participantVo);
        }
        listVo1.addAll(linkedHashMap.values());
//        List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values());
        return listVo1;
    }
@@ -213,6 +208,7 @@
        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()));
cloud-server-competition/src/main/java/com/dsh/competition/util/PayMoneyUtil.java
@@ -49,13 +49,13 @@
    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";//支付回调网关地址
@@ -359,7 +359,7 @@
        }
        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);
cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackageOrderStudentController.java
@@ -1,8 +1,10 @@
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.*;
@@ -20,9 +22,15 @@
    @Autowired
    private ICoursePackageOrderStudentService coursePackageOrderStudentService;
    @Autowired
    private ICoursePackageOrderService coursePackageOrderService;
    /**
     * 根据学院id获取剩余有效课时数据
     * 根据学员id获取剩余有效课时数据
     * @param studentId
     * @return
     */
@@ -35,6 +43,21 @@
    }
    /**
     * 根据用户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
cloud-server-course/src/main/java/com/dsh/course/service/impl/CoursePackageOrderStudentServiceImpl.java
@@ -233,32 +233,39 @@
                //未上的排课数据
                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());
                    if(collect.size() > 0){
                    coursePackageSchedulingService.removeByIds(collect);
                    coursePackageStudentMapper.delete(new QueryWrapper<CoursePackageStudent>().in("coursePackageSchedulingId", collect));
                    deductionClassHour.setScheduledCourses(n);
                }
                    deductionClassHour.setScheduledCourses(num);
                }else{
                    deductionClassHour.setScheduledCourses(0);
                }
                this.updateById(coursePackageOrderStudent);
                CourseCounsum courseCounsum = new CourseCounsum();
@@ -293,16 +300,17 @@
            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();
            if(scheduledCourses > 0){
            TCoursePackage coursePackage = coursePackageService.getById(coursePackageOrderStudent.getCoursePackageId());
            Integer codeTime = coursePackage.getCodeTime();
            CoursePackageScheduling one = coursePackageSchedulingService.getOne(new QueryWrapper<CoursePackageScheduling>().eq("studentId", coursePackageOrderStudent.getStudentId())
@@ -342,7 +350,7 @@
                    } catch (ParseException e) {
                        throw new RuntimeException(e);
                    }
                    if(classDate.getTime() <= parse.getTime()){
                        if(classDate.getTime() >= parse.getTime()){
                        continue;
                    }
@@ -370,7 +378,7 @@
                    coursePackageStudentMapper.insert(student1);
                    num--;
                    if(num == 0){
                        if(num <= 0){
                        return;
                    }
                }
@@ -379,7 +387,7 @@
                start = calendar;
            }
            if(num == 0){
                if(num <= 0){
                return;
            }
@@ -425,12 +433,13 @@
                        e.printStackTrace();
                    }
                    num--;
                    if(num == 0){
                        if(num <= 0){
                        return;
                    }
                }
                start.set(Calendar.DAY_OF_YEAR, start.get(Calendar.DAY_OF_YEAR) + 1);
            }
            }
        }
cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackageServiceImpl.java
@@ -1335,17 +1335,22 @@
                    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(b){
                    addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent, student.getValidity());
                    }
                    //课时记录
                    CourseCounsum courseCounsum = new CourseCounsum();
@@ -1378,17 +1383,20 @@
                    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());
                    }
cloud-server-course/src/main/java/com/dsh/course/util/PayMoneyUtil.java
@@ -51,10 +51,11 @@
    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";//微信商户号
@@ -349,7 +350,7 @@
        }
        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);
cloud-server-management/src/main/java/com/dsh/course/feignClient/communityWorldCup/WorldCupStoreClient.java
@@ -28,7 +28,7 @@
     * 删除世界杯门店关系数据
     * @param worldCupId
     */
    @PostMapping("/worldCup/addWorldCupStore")
    @PostMapping("/worldCup/delWorldCupStore")
    void delWorldCupStore(@RequestBody Integer worldCupId);
cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/HonorRules.java
@@ -31,7 +31,7 @@
    @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;
cloud-server-management/src/main/webapp/WEB-INF/view/system/tHonor/THonor.html
@@ -71,11 +71,11 @@
                                    <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>
cloud-server-management/src/main/webapp/WEB-INF/view/system/worldCup/worldCup_info.html
@@ -204,8 +204,8 @@
    </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">
cloud-server-management/src/main/webapp/static/modular/system/tHonor/THonor.js
@@ -80,7 +80,7 @@
    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);
@@ -91,7 +91,7 @@
    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);
cloud-server-management/src/main/webapp/static/modular/system/worldCup/worldCup.js
@@ -91,7 +91,30 @@
};
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);
    }
}
cloud-server-management/src/main/webapp/static/modular/system/worldCupRecords/worldCupRecords.js
@@ -114,7 +114,7 @@
$(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',},
cloud-server-other/src/main/java/com/dsh/other/controller/HonorController.java
@@ -150,10 +150,10 @@
                        stuMedalVo.setMedalName("深度玩家");
                        break;
                    case 5:
                        stuMedalVo.setMedalName("赢家");
                        stuMedalVo.setMedalName("常胜将军");
                        break;
                    case 6:
                        stuMedalVo.setMedalName("次数");
                        stuMedalVo.setMedalName("越战越勇");
                        break;
                    default:
                        break;
cloud-server-other/src/main/java/com/dsh/other/entity/HonorRules.java
@@ -31,7 +31,7 @@
    @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;
cloud-server-other/src/main/java/com/dsh/other/feignclient/model/StuMedalVo.java
@@ -7,7 +7,7 @@
@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 = "勋章名称 例如:俱乐部之星")
cloud-server-other/src/main/java/com/dsh/other/util/PayMoneyUtil.java
@@ -52,13 +52,13 @@
    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";//支付回调网关地址
@@ -400,7 +400,7 @@
        }
        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);