puzhibing
2024-03-05 6d5893672dc31b6c7bfa39801ddd95516014c380
Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0

 Conflicts:
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupService.java
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
7个文件已修改
1个文件已添加
160 ■■■■■ 已修改文件
cloud-server-account/src/main/java/com/dsh/account/controller/RefereeController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/entity/WorldCup.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/mapper/WorldCupMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/WorldCupListAll.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/controller/RefereeController.java
@@ -60,4 +60,14 @@
    public Referee getRefereeById(@RequestBody Integer id){
        return refereeService.getById(id);
    }
    /**
     * 修改裁判数据
     * @param referee
     */
    @PostMapping("/referee/editReferee")
    public void editReferee(@RequestBody Referee referee){
        refereeService.updateById(referee);
    }
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
@@ -511,6 +511,18 @@
                .eq("participantId", studentId).eq("participantType", 1).eq("matchResult", 1));
    }
    /**
     * 获取比赛管理列表数据
     * @param worldCupListAll
     * @return
     */
    @ResponseBody
    @PostMapping("/worldCup/getWorldCupListAll")
    public Map<String, Object> getWorldCupListAll(@RequestBody WorldCupListAll worldCupListAll){
        return worldCupService.getWorldCupListAll(worldCupListAll);
    }
    /**
     * 添加社区世界杯
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/entity/WorldCup.java
@@ -65,7 +65,7 @@
     * 支付方式(1=免费,2=现金支付,3=玩湃币支付,4=课时支付)
     */
    @TableField("payType")
    private Integer payType;
    private String payType;
    /**
     * 现金
     */
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/mapper/WorldCupMapper.java
@@ -6,6 +6,7 @@
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @author zhibing.pu
@@ -37,4 +38,16 @@
     */
    WorldCupInfo getWorldCupInfo(@Param("id") Integer id);
    /**
     * 获取比赛管理列表数据
     * @param worldCupListAll
     * @return
     */
    List<Map<String, Object>> getWorldCupListAll(@Param("item") WorldCupListAll worldCupListAll);
    Integer getWorldCupListAllCount(@Param("item") WorldCupListAll worldCupListAll);
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/model/WorldCupListAll.java
New file
@@ -0,0 +1,35 @@
package com.dsh.communityWorldCup.model;
import lombok.Data;
/**
 * @author zhibing.pu
 * @date 2024/3/2 11:01
 */
@Data
public class WorldCupListAll {
    /**
     * 比赛名称
     */
    private String name;
    /**
     * 开始时间
     */
    private String startTime;
    /**
     * 结束时间
     */
    private String endTime;
    /**
     * 比赛状态(1=未开始,2=已开始,3=已结束,4=已取消)
     */
    private Integer status;
    /**
     * 页码
     */
    private Integer offset;
    /**
     * 页条数
     */
    private Integer limit;
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/IWorldCupService.java
@@ -7,6 +7,7 @@
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
/**
 * @author zhibing.pu
@@ -84,4 +85,12 @@
     * @param id
     */
    void cancelWorldCupRefund(Integer id);
    /**
     * 获取比赛管理列表数据
     * @param worldCupListAll
     * @return
     */
    Map<String, Object> getWorldCupListAll(WorldCupListAll worldCupListAll);
}
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
@@ -411,7 +411,8 @@
        worldCupPayment.setEntrant(paymentWorldCup.getIds());
        int num = JSON.parseArray(paymentWorldCup.getIds()).size();
        //不免费
        if(worldCup.getPayType() != 0){
        String payType1 = worldCup.getPayType().split(",")[0];
        if(!"0".equals(payType1)){
            Integer payType = paymentWorldCup.getPayType();
            //微信
            if(payType == 1){
@@ -606,6 +607,33 @@
    /**
     * 获取比赛管理列表数据
     * @param worldCupListAll
     * @return
     */
    @Override
    public Map<String, Object> getWorldCupListAll(WorldCupListAll worldCupListAll) {
        Map<String, Object> map = new HashMap<>();
        List<Map<String, Object>> list = this.baseMapper.getWorldCupListAll(worldCupListAll);
        for (Map<String, Object> map1 : list) {
            String maxPeople = map1.get("maxPeople").toString();
            Integer id = Integer.valueOf(map1.get("id").toString());
            List<WorldCupPayment> lists = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", id).eq("payStatus", 2).eq("state", 1));
            List<Long> collect = lists.stream().map(WorldCupPayment::getId).collect(Collectors.toList());
            Integer count = 0;
            if(collect.size() > 0){
                count = worldCupPaymentParticipantService.count(new QueryWrapper<WorldCupPaymentParticipant>().in("worldCupPaymentId", collect));
            }
            map1.put("maxPeople", maxPeople + " - " + count);
        }
        Integer count = this.baseMapper.getWorldCupListAllCount(worldCupListAll);
        map.put("rows", list);
        map.put("total", count);
        return map;
    }
    /**
     * 取消赛事后退还费用
     * @param id
     */
cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupMapper.xml
@@ -71,4 +71,53 @@
        from t_world_cup  a
        where a.id = #{id}
    </select>
    <select id="getWorldCupListAll" resultType="map">
        select
        id,
        `name`,
        DATE_FORMAT(startTime, '%Y.%m.%d %H:%i') as startTime,
        DATE_FORMAT(endTime, '%Y.%m.%d %H:%i') as endTime,
        CONCAT(startAge, '至', endAge) as age,
        gender,
        maxPeople,
        status
        from t_world_cup
        where 1 = 1
        <if test="null != item.name and '' != item.name">
            and `name` like CONCAT('%', #{item.name}, '%')
        </if>
        <if test="null != item.startTime and '' != item.startTime">
            and DATE_FORMAT(startTime, '%Y-%m-%d') &gt;= #{item.startTime}
        </if>
        <if test="null != item.endTime and '' != item.endTime">
            and DATE_FORMAT(endTime, '%Y-%m-%d') &lt;= #{item.endTime}
        </if>
        <if test="null != item.status">
            and status= #{item.status}
        </if>
        order by createTime desc limit #{item.offset}, #{item.limit}
    </select>
    <select id="getWorldCupListAllCount" resultType="int">
        select
        count(*)
        from t_world_cup
        where 1 = 1
        <if test="null != item.name and '' != item.name">
            and `name` like CONCAT('%', #{item.name}, '%')
        </if>
        <if test="null != item.startTime and '' != item.startTime">
            and DATE_FORMAT(startTime, '%Y-%m-%d') &gt;= #{item.startTime}
        </if>
        <if test="null != item.endTime and '' != item.endTime">
            and DATE_FORMAT(endTime, '%Y-%m-%d') &lt;= #{item.endTime}
        </if>
        <if test="null != item.status">
            and status= #{item.status}
        </if>
    </select>
</mapper>