puzhibing
2024-03-01 b8f40c53b53020b52904d84950ac2f25384ecdb1
开发管理后台世界杯模块
17个文件已修改
1个文件已添加
271 ■■■■ 已修改文件
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/WorldCupCompetitorClient.java 30 ●●●●● 补丁 | 查看 | 原始文档 | 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/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/StudentHonorServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/EditHonorVO.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/advertisement/advertisement.html 76 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/WEB-INF/view/system/tHonor/THonor.html 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-management/src/main/webapp/static/modular/system/tHonor/THonor.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-other/src/main/java/com/dsh/other/controller/HonorController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | 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/model/vo/honorVo/EditHonorVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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=深度玩家)
     * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)
     */
    @TableField("type")
    private Integer type;
cloud-server-account/src/main/java/com/dsh/account/feignclient/communityWorldCup/WorldCupCompetitorClient.java
New file
@@ -0,0 +1,30 @@
package com.dsh.account.feignclient.communityWorldCup;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
/**
 * @author zhibing.pu
 * @Date 2024/3/1 10:04
 */
@FeignClient("mb-cloud-communityWorldCup")
public interface WorldCupCompetitorClient {
    /**
     * 获取学员参与世界杯次数
     * @param studentId
     * @return
     */
    @PostMapping("/worldCup/count")
    Integer count(Integer studentId);
    /**
     * 获取学员世界杯胜利次数
     * @param studentId
     * @return
     */
    @PostMapping("/worldCup/winCount")
    Integer winCount(Integer studentId);
}
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=深度玩家)
     * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)
     */
    private Integer type;
    /**
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=深度玩家)")
    @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=深度玩家)")
    @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)")
    private Integer medalType;
    @ApiModelProperty(value = "勋章名称 例如:俱乐部之星")
cloud-server-account/src/main/java/com/dsh/account/service/impl/StudentHonorServiceImpl.java
@@ -5,6 +5,7 @@
import com.dsh.account.entity.HonorRules;
import com.dsh.account.entity.StudentHonor;
import com.dsh.account.entity.TStudent;
import com.dsh.account.feignclient.communityWorldCup.WorldCupCompetitorClient;
import com.dsh.account.feignclient.competition.ParticipantClient;
import com.dsh.account.feignclient.course.CoursePackageClient;
import com.dsh.account.feignclient.course.model.CoursePackage;
@@ -54,6 +55,9 @@
    @Autowired
    private HonorRulesClient honorRulesClient;
    @Resource
    private WorldCupCompetitorClient worldCupCompetitorClient;
@@ -125,6 +129,21 @@
            voList.add(vo);
        }
        Integer count5 = worldCupCompetitorClient.winCount(stuId);
        if (count5 > 0) {
            GongVo vo = new GongVo();
            vo.setMedalType(5);
            vo.setMedalName("赢家");
            voList.add(vo);
        }
        Integer count6 = worldCupCompetitorClient.count(stuId);
        if (count6 > 0) {
            GongVo vo = new GongVo();
            vo.setMedalType(6);
            vo.setMedalName("次数");
            voList.add(vo);
        }
        return voList;
    }
@@ -150,6 +169,12 @@
                case 4:
                    vo.setMedalName("深度玩家");
                    break;
                case 5:
                    vo.setMedalName("赢家");
                    break;
                case 6:
                    vo.setMedalName("次数");
                    break;
            }
            //拿到当前对应的rule对象
            List<Integer> integers = new ArrayList<>();
cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.communityWorldCup.entity.WorldCup;
import com.dsh.communityWorldCup.entity.WorldCupCompetitor;
import com.dsh.communityWorldCup.entity.WorldCupPaymentParticipant;
import com.dsh.communityWorldCup.entity.WorldCupStore;
import com.dsh.communityWorldCup.feignclient.account.AppUserClient;
@@ -481,6 +482,28 @@
    }
    /**
     * 获取学员参与数量
     * @param studentId
     * @return
     */
    @ResponseBody
    @PostMapping("/worldCup/count")
    public Integer count(@RequestBody Integer studentId){
        return worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>()
                .eq("participantId", studentId).eq("participantType", 1));
    }
    /**
     * 获取学员世界杯胜利次数
     * @param studentId
     * @return
     */
    @ResponseBody
    @PostMapping("/worldCup/winCount")
    public Integer winCount(Integer studentId){
        return worldCupCompetitorService.count(new QueryWrapper<WorldCupCompetitor>()
                .eq("participantId", studentId).eq("participantType", 1).eq("matchResult", 1));
    }
}
cloud-server-management/src/main/java/com/dsh/course/feignClient/other/model/EditHonorVO.java
@@ -11,6 +11,8 @@
    private data type2;
    private data type3;
    private data type4;
    private data type5;
    private data type6;
    public static class data {
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=深度玩家)
     * 数据类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)
     */
    @TableField("type")
    private Integer type;
cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement.html
@@ -14,49 +14,45 @@
                            </div>
                            <div class="col-sm-3">
                                <#SelectCon id="page" name="跳转页面" >
                                <option value="">请选择</option>
                                @for(obj in pages){
                                <option value="${obj.id}">${obj.name}</option>
                                @}
                            </#SelectCon>
                                    <option value="">请选择</option>
                                    @for(obj in pages){
                                    <option value="${obj.id}">${obj.name}</option>
                                    @}
                                </#SelectCon>
                            </div>
                            <div class="col-sm-3">
                                <#SelectCon id="state" name="状态" >
                                    <option value="">全部</option>
                                    <option value="1">已上架</option>
                                    <option value="2">已下架</option>
                                </#SelectCon>
                            </div>
                            <div class="col-sm-3">
                                <#button name="搜索" icon="fa-search" clickFun="TSite.search()"/>
                                <#button name="重置" icon="fa-trash" clickFun="TSite.resetSearch()" space="true"/>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <#SelectCon id="state" name="状态" >
                            <option value="">全部</option>
                            <option value="1">已上架</option>
                            <option value="2">已下架</option>
                        </#SelectCon>
                    </div>
                    <div class="col-sm-3">
                        <#button name="搜索" icon="fa-search" clickFun="TSite.search()"/>
                        <#button name="重置" icon="fa-trash" clickFun="TSite.resetSearch()" space="true"/>
                        <div class="hidden-xs" id="TSiteTableToolbar" role="group">
                            @if(shiro.hasPermission("/advertisement/add")){
                            <#button name="添加" icon="fa-plus" clickFun="TSite.openAddTSite()"/>
                            @}
                            @if(shiro.hasPermission("/advertisement/update")){
                            <#button name="编辑" icon="fa-edit" clickFun="TSite.openEditTSite()" space="true"/>
                            @}
                            @if(shiro.hasPermission("/advertisement/info")){
                            <#button name="查看详情" icon="fa-search" clickFun="TSite.openInfo()" space="true"/>
                            @}
                            @if(shiro.hasPermission("/advertisement/changeState")){
                            <#button name="上架" icon="fa-check" clickFun="TSite.onShelf()" space="true"/>
                            <#button name="下架" icon="fa-remove" clickFun="TSite.offShelf()" space="true"/>
                            @}
                        </div>
                        <#table id="TSiteTable"/>
                    </div>
                </div>
                <div class="hidden-xs" id="TCompetitionTableToolbar" role="group">
                    @if(shiro.hasPermission("/advertisement/add")){
                    <#button name="添加" icon="fa-plus" clickFun="TSite.openAddTSite()"/>
                    @}
                    @if(shiro.hasPermission("/advertisement/update")){
                    <#button name="编辑" icon="fa-edit" clickFun="TSite.openEditTSite()" space="true"/>
                    @}
                    @if(shiro.hasPermission("/advertisement/info")){
                    <#button name="查看详情" icon="fa-search" clickFun="TSite.openInfo()" space="true"/>
                    @}
                    @if(shiro.hasPermission("/advertisement/changeState")){
                    <#button name="上架" icon="fa-check" clickFun="TSite.onShelf()" space="true"/>
                    <#button name="下架" icon="fa-remove" clickFun="TSite.offShelf()" space="true"/>
                    @}
                </div>
                <#table id="TSiteTable"/>
</div>
</div>
</div>
</div>
</div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/modular/system/advertisement/advertisement.js"></script>
<script>
cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html
@@ -53,9 +53,11 @@
                    <select style="width: 300px" class="form-control" id="position" onchange="updatePosition(this)" name = "position">
                        <option value="">选择类型</option>
                        <option value="1">首页banner</option>
                        <option value="2">线上课得积分</option>
                        <option value="3">看视频得奖励</option>
                        <option value="4">常见问题</option>
                        <option value="3">线上课得积分</option>
                        <option value="4">看视频得奖励</option>
                        <option value="5">常见问题</option>
                        <option value="6">社区世界杯顶部banner</option>
                        <option value="7">社区世界杯底部banner</option>
                    </select>
                </div>
            </div>
cloud-server-management/src/main/webapp/WEB-INF/view/system/tHonor/THonor.html
@@ -60,16 +60,24 @@
                                    <h3 class = "title">运动达人:</h3>
                                    <div id="table2"></div>
                                </div>
                            </div>
                            <div class="row" id = "table-container-2">
                                <div class="table-container">
                                    <h3 class = "title">社区之王:</h3>
                                    <div id="table3"></div>
                                </div>
                            </div>
                            <div class="row" id = "table-container-2">
                                <div class="table-container">
                                    <h3 class = "title">深度玩家:</h3>
                                    <div id="table4"></div>
                                </div>
                                <div class="table-container">
                                    <h3 class = "title">赢家:</h3>
                                    <div id="table5"></div>
                                </div>
                                <div class="table-container">
                                    <h3 class = "title">次数:</h3>
                                    <div id="table6"></div>
                                </div>
                            </div>
                            <div class="row btn-group-m-t">
                                <div class="col-sm-10 col-sm-offset-5" id = "buttonEdit">
cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js
@@ -486,12 +486,13 @@
    var carPhoto7 = new $WebUpload("cover7");
    carPhoto7.setUploadBarId("progressBar");
    carPhoto7.init();
    var carPhoto = new $WebUpload("img");
    carPhoto.setUploadBarId("progressBar");
    carPhoto.init();
    var defaultColunms = TSite.initColumn();
    var table = new BSTable(TSite.id, "/advertisement/listAll", defaultColunms);
    table.setPaginationType("client");
    TSite.table = table.init();
    var carPhoto = new $WebUpload("img");
    carPhoto.setUploadBarId("progressBar");
    carPhoto.init();
});
cloud-server-management/src/main/webapp/static/modular/system/tHonor/THonor.js
@@ -21,6 +21,12 @@
    },type4:{
        type:null,
        condition:[]
    },type5:{
        type:null,
        condition:[]
    },type6:{
        type:null,
        condition:[]
    }
};
THonor.edit = function(){
@@ -70,6 +76,28 @@
        }
    }
    var input5 = document.querySelectorAll('#input5');
    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));
        }
        if (i === input5.length-1-1){
            data1.type5.condition.push(input5[i+1].value);
        }
    }
    var input6 = document.querySelectorAll('#input6');
    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));
        }
        if (i === input6.length-1-1){
            data1.type6.condition.push(input6[i+1].value);
        }
    }
    $.ajax({
        url: Feng.ctxPath + "/tHonor/edit",
        type: "POST",
@@ -80,6 +108,8 @@
            data1.type2.condition= [];
            data1.type3.condition= [];
            data1.type4.condition= [];
            data1.type5.condition= [];
            data1.type6.condition= [];
            Feng.success("修改成功!");
        },
        error: function(xhr, status, error) {
@@ -87,6 +117,8 @@
            data1.type2.condition= [];
            data1.type3.condition= [];
            data1.type4.condition= [];
            data1.type5.condition= [];
            data1.type6.condition= [];
            var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!";
            Feng.error(errorMessage);
        }
@@ -99,12 +131,16 @@
    var tableContainer2 = document.getElementById('table2');
    var tableContainer3 = document.getElementById('table3');
    var tableContainer4 = document.getElementById('table4');
    var tableContainer5 = document.getElementById('table5');
    var tableContainer6 = document.getElementById('table6');
// 初始化四个表格
    var table1 = createTable(['等级', '上课打卡次数'], tableContainer1);
    var table2 = createTable(['等级', '赛事报名次数'], tableContainer2);
    var table3 = createTable(['等级', '预约场地次数'], tableContainer3);
    var table4 = createTable(['等级', '作业、任务完成次数'], tableContainer4);
    var table5 = createTable(['等级', '社区世界杯胜利场次'], tableContainer5);
    var table6 = createTable(['等级', '社区世界杯参与场次'], tableContainer6);
    var ajax = new $ax(Feng.ctxPath + "/tHonor/list", function(data){
        populateTable(table1, data[1],1);
@@ -115,6 +151,10 @@
        data1.type3.type = data[3][1].type;
        populateTable(table4, data[4],4);
        data1.type4.type = data[4][1].type;
        populateTable(table5, data[5],5);
        data1.type5.type = data[5][1].type;
        populateTable(table6, data[6],6);
        data1.type6.type = data[6][1].type;
    },function(data){
        Feng.error("获取失败!" + data.responseJSON.message + "!");
    });
cloud-server-other/src/main/java/com/dsh/other/controller/HonorController.java
@@ -51,7 +51,7 @@
        QueryWrapper<HonorRules> wrapper2 = new QueryWrapper<>();
        wrapper2.eq("type", type2);
        List<HonorRules> list2 = hrService.list(wrapper2);
        for (int i = 0; i < list1.size(); i++) {
        for (int i = 0; i < list2.size(); i++) {
            list2.get(i).setCondition(Integer.valueOf(condition2.get(i)));
        }
        hrService.updateBatchById(list2);
@@ -61,7 +61,7 @@
        QueryWrapper<HonorRules> wrapper3 = new QueryWrapper<>();
        wrapper3.eq("type", type3);
        List<HonorRules> list3 = hrService.list(wrapper3);
        for (int i = 0; i < list1.size(); i++) {
        for (int i = 0; i < list3.size(); i++) {
            list3.get(i).setCondition(Integer.valueOf(condition3.get(i)));
        }
        hrService.updateBatchById(list3);
@@ -71,10 +71,30 @@
        QueryWrapper<HonorRules> wrapper4 = new QueryWrapper<>();
        wrapper4.eq("type", type4);
        List<HonorRules> list4 = hrService.list(wrapper4);
        for (int i = 0; i < list1.size(); i++) {
        for (int i = 0; i < list4.size(); i++) {
            list4.get(i).setCondition(Integer.valueOf(condition4.get(i)));
        }
        hrService.updateBatchById(list4);
        Integer type5 = vo.getType5().getType();
        List<String> condition5 = vo.getType5().getCondition();
        QueryWrapper<HonorRules> wrapper5 = new QueryWrapper<>();
        wrapper5.eq("type", type5);
        List<HonorRules> list5 = hrService.list(wrapper4);
        for (int i = 0; i < list5.size(); i++) {
            list5.get(i).setCondition(Integer.valueOf(condition5.get(i)));
        }
        hrService.updateBatchById(list5);
        Integer type6 = vo.getType6().getType();
        List<String> condition6 = vo.getType6().getCondition();
        QueryWrapper<HonorRules> wrapper6 = new QueryWrapper<>();
        wrapper6.eq("type", type6);
        List<HonorRules> list6 = hrService.list(wrapper6);
        for (int i = 0; i < list6.size(); i++) {
            list6.get(i).setCondition(Integer.valueOf(condition6.get(i)));
        }
        hrService.updateBatchById(list6);
        return ResultUtil.success();
    }
@@ -129,6 +149,12 @@
                    case 4:
                        stuMedalVo.setMedalName("深度玩家");
                        break;
                    case 5:
                        stuMedalVo.setMedalName("赢家");
                        break;
                    case 6:
                        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=深度玩家)
     * 数据类型(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=深度玩家)")
    @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家,5=赢家,6=次数)")
    private Integer medalType;
    @ApiModelProperty(value = "勋章名称 例如:俱乐部之星")
cloud-server-other/src/main/java/com/dsh/other/model/vo/honorVo/EditHonorVO.java
@@ -13,6 +13,8 @@
    private data type2;
    private data type3;
    private data type4;
    private data type5;
    private data type6;
    public static class data {